Making Dynamsoft Barcode SDK an Addon for Node.js Computers Articles | July 4 Authentic Connor Brown Jersey , 2015 Do you know which programming language is currently ranking first on GitHub? It is JavaScript! JavaScript is not only used for HTML5 Web application development, but also for server-side programming...
Do you know which programming language is currently ranking first on GitHub? It is JavaScript! JavaScript is not only used for HTML5 Web application development, but also for server-side programming with runtime environment Node.js. With npm, the package manager for Node.js, it is so easy to install any Web frameworks or utilities. Although Node.js has provided many powerful JavaScript APIs Authentic Nikita Zaitsev Jersey , sometimes we have to create add-ons to empower Node.js with extra functionalities. In this tutorial, I’d like to share how to implement a JavaScript Barcode application with the custom addon, wrapped with CC++ APIs of Dynamsoft Barcode SDK, for Node.js.
?
Setting Up Environment for Node.js Addon Development
To build add-ons for Node.js, we need to install the tool node-gyp:
1 npm install -g node-gyp
Create an empty CC++ file dbr.cc and a configuration file binding.gyp. Specify add-on name and CC++ source files:
For more information, please read the basic tutorial of Node.js addons.
Wrapping Dynamsoft Barcode SDK as the Addon for Node.js
Let’s double-click binding.sln to import the project to Visual Studio. Since node-gyp has added Node.js-relevant configurations, you just need to insert the directories of Dynamsoft Barcode SDK header files and libraries. Besides, add the post-build event: