Skip to content

NickNaso/addon-stream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

How to use Stream on Node.js Native Add-ons

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

Examples

Node.js C / C ++ Addons

N-API

Node Addon API

Header-only C++ wrapper classes for the ABI-stable Node.js API

Web resources

Nicola Del Gobbo

https://github.com/NickNaso/

https://www.npmjs.com/~nicknaso

https://twitter.com/NickNaso

Acknowledgements

Thank you to all people that encourage me every day.

License

Licensed under Apache license V2