how to implement this jsbarcode npm on convert phone or mobile number to bar code using cloud function and nodejs
var jsbarcode = require("jsbarcode")
<img id="barcode"/>
$("#barcode").JsBarcode("Hi!");
JsBarcode("#barcode", "1234", {
format: "pharmacode",
lineColor: "#0aa",
width:4,
height:40,
displayValue: false
});
For using JsBarcode in NodeJS, you need canvas (node-canvas), not HTML image tag.
Install canvas
Then use it with
jsbarcode
Please refer node-canvas GitHub page for more details.