senecajs-labs / seneca-entity-save-stream

Stream down your seneca entities
MIT License
4 stars 4 forks source link

Seneca

A Seneca.js plugin

seneca-entity-save-stream

Gitter

Stream down and build seneca entities!

If you're using this module, and need help, you can:

If you are new to Seneca in general, please take a look at senecajs.org. We have everything from tutorials to sample apps to help get you up and running quickly.

Install

To install, simply use npm. Remember you will need to install Seneca.js if you haven't already.

npm install seneca-entity-save-stream

Test

To run tests, simply use npm:

npm run test

Example

'use strict'

var seneca = require('seneca')()
var entSaveStream = require('..')
var pear = seneca.make('pear')
var 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) {
    if (!err) console.log(res)
  })
})

Contributing

The Senecajs org encourages open participation. If you feel you can help in any way, be it with documentation, examples, extra testing, or new features please get in touch.

Acknowledgements

This project was kindly sponsored by nearForm.

License

Copyright Matteo Collina and other contributors 2014 - 2016, Licensed under MIT.