You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sebastian Thomas edited this page Jul 26, 2019
·
2 revisions
Step 1. Install the node-canvas dependencies
JsBarcode for Node.js is dependent on node-canvas to work. It does have some dependencies outside of npm to work. Make sure to install them by following the instructions in their readme.
Step 2. Install JsBarcode and node-canvas
npm install canvas
npm install jsbarcode
Step 3. Use it!
constJsBarcode=require('jsbarcode');const{ Canvas }=require("canvas");constcanvas=newCanvas();JsBarcode(canvas,"Hello");// Do what you want with the canvas// See https://github.com/Automattic/node-canvas for more information