node package manager
Stop wasting time. Easily manage code sharing in your team. Create a free org »

seneca-entity-save-stream

seneca-entity-save-stream

Stream down and build seneca entities!

var seneca        = require('seneca')()
  , entSaveStream = require('seneca-entity-save-stream')
  , pear          = seneca.make('pear')
  , pearImporter  = entSaveStream(seneca, { name$: 'pear' })
 
pearImporter.on('one', function() {
  console.log('element saved')
})
 
pearImporter.end({
  name: 'my pear',
  price: 200
}, function() {
  pear.list$({}, function(err, res) {
    console.log(res)
  })
})

Acknowledgements

This project was kindly sponsored by nearForm.

License

MIT