title: Streaming data into a Node.js C++ Addon with N-API
body: <p>I am building a C++ addon for NodeJS and I want to stream data asynchronously from C++ to Node. I have found this article, <a href="https://nodeaddons.com/streaming-data-into-a-node-js-c-addon/" rel="noreferrer">https://nodeaddons.com/streaming-data-into-a-node-js-c-addon/</a>, however; I want to use the N-API instead of NAN. </p>
  
  <p>I have been searching through the NodeJS docs and examples as well as looking for other resources and examples but have not come across a resource to show me how I can accomplish this. This is my first time writing a C++ addon for NodeJS. </p>
  
  <p>An example that would help me get started would be an addon that uses the N-API to send a dummy string every second to Node and Node would print the string to the console.</p>