3.0.16 • Published 9 months ago

@ashok_gujjar92/symbology_18 v3.0.16

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
9 months ago

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 docs →

Quick start

yarn add symbology

Quick Examples

Code 11 Example

import { SymbologyType, createStream } from 'symbology'

(async () => {
  const { data } = await createStream({
    symbology: SymbologyType.CODE11
  }, '8765432164')

  console.log('Result: ', data)
})()

This will log:

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

And the base64 PNG generated will look like:

code 11

MaxiCode Example

import { SymbologyType, createFile } from 'symbology'

(async () => {
  const { data } = await createFile({
    symbology: SymbologyType.MAXICODE,
    option1: 2,
    primary: '999999999840012',
    fileName: 'maxiCodeExample.svg'
  }, 'Secondary Message Here')

  console.log('Result: ', data)
})()

This creates maxiCodeExample.svg which looks like:

MaxiCode

USPS Example

import { SymbologyType, createFile } from 'symbology'

(async () => {
  const { data } = await createFile({
    symbology: SymbologyType.ONECODE
    fileName: 'uspsExample.eps'
  }, '01234567094987654321-01234')

  console.log('Result: ', data)
})()

This creates uspsExample.eps which looks like:

USPS

License

GPL-3.