tualo-barcode

0.0.1 • Public • Published

Description

tualo-barcode can be used to create barcode images as svg. There are no native depenencies needed.

Currently suppored are:

  • Code39
  • Datamatrix

Requirements

Installation

npm install tualo-barcode

How to Use

var http = require('http');
var Barcode = require('tualo-barcode').Barcode;

var server = http.createServer(function(req, res) {
	res.writeHead(200);
	var code_39_svg = (new Barcode({
		type: 'Code39',
		width: 300
	})).getSVG('tualo.de',true);

	var datamatrix_svg = (new Barcode({
		type: 'Datamatrix',
		fillColor: 'blue',
		strokeColor: 'darkblue',
		strokeWidth: 1,
		width: 'auto',
		height: 'auto'
	})).getSVG('http://tualo.de',true);
	
	res.end('<html><body style="background: white;">'+code_39_svg+'<br/><br/>'+datamatrix_svg+'</body></html>');
});

server.listen(parseInt(process.env.PORT) || 3000);
console.log("server listening on port %d …", server.address().port);

Dependencies (2)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i tualo-barcode

    Weekly Downloads

    2

    Version

    0.0.1

    License

    none

    Last publish

    Collaborators

    • tualo