Skip to content

tualo/tualo-barcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •