symbology-1.18.0

1.18.0 • Public • Published

Symbology Logo

A Node.js module that generates barcode images. Supports 50+ different 1D or 2D symbologies in png, eps, or svg formats.

Code coverage Build status: Travis Build status: AppVeyor

Introduction

This Node.js module will allow you to generate over 50+ different types of 1D or 2D symbologies, including barcodes for books, grocery, shipping carriers, healthcare, and international codes.

It can create a PNG, SVG, or EPS image file, or return a string containing SVG, PostScript, or base64-encoded PNG data.

Documentation

Read the comprehensive docs →

Quick start

yarn add symbology

Quick Examples

Code 11 Example

const symbology = require('symbology')
 
symbology
  .createStream({
    symbology: symbology.Barcode.CODE128
  }, '8765432164')
  .then((data) => {
    console.log('Result: ', data)
  })

This will log:

{
  "data": "data:image/png+data;base64,PHN [...] eFd==",
  "message": "",
  "code": 0
}

And the base64 PNG generated will look like:

code 11

MaxiCode Example

symbology
  .createFile({
    symbology: Symbology.Barcode.MAXICODE,
    option1: 2,
    primary: '999999999840012',
    fileName: 'maxiCodeExample.svg'
  }, 'Secondary Message Here')
  .then((data) => {
    console.log('Result: ', data)
  })

This creates maxiCodeExample.svg which looks like:

MaxiCode

USPS Example

symbology
  .createFile({
    symbology: Symbology.Barcode.ONECODE
    fileName: 'uspsExample.eps'
  }, '01234567094987654321-01234')
  .then((data) => {
    console.log('Result: ', data)
  })

This creates uspsExample.eps which looks like:

USPS

License

GPL-3.

Package Sidebar

Install

npm i symbology-1.18.0

Weekly Downloads

1

Version

1.18.0

License

GPL-3.0

Unpacked Size

295 kB

Total Files

96

Last publish

Collaborators

  • john-doherty