How to use and create stream on Node.js native add-ons with N-API
A stream is an abstract interface for working with streaming data in Node.js. The stream module provides a base API that makes it easy to build objects that implement the stream interface.
There are many stream objects provided by Node.js. For instance, a request to an HTTP server and process.stdout are both stream instances.
Streams can be readable, writable, or both. All streams are instances of EventEmitter.
Here you can find an examples where I used a Transform stream to pass and get back data from a native add-on. This is a simple passthrough example.
In the passthrough directory, run:
$ npm install
$ node-gyp rebuild
$ node index.js or npm start
- How I ported bcrypt to new N-API
- N-API the next API for Native Addons
- N-API Next generation Node API for native modules
- Speed up Your Node.js App with Native Addons
- Start with N-API
- How to get a performance boost using Node.js native addons
https://www.npmjs.com/~nicknaso
Thank you to all people that encourage me every day.
Licensed under Apache license V2