bwip-js is a JavaScript library that provides a comprehensive barcode generation solution, translating the Barcode Writer in Pure PostScript (BWIPP) code into native JavaScript. It supports over 100 different barcode types and standards, including all common linear and two-dimensional formats. The library is currently at version 4.9.2, with its underlying BWIPP engine updated to 2026-03-31. Releases are frequent, typically coinciding with BWIPP updates or critical bug fixes, as seen with recent rapid patches for version 4.9.x. It differentiates itself by offering broad platform support (browsers, Node.js, React, React Native, Electron) and output formats (PNG, Canvas, SVG), and by being a pure JavaScript implementation requiring no external binaries or server-side rendering other than a JavaScript runtime.
npm install bwip-jsVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to generate a Code 128 barcode as a PNG buffer using the `@bwip-js/node` package and save it to a local file. This showcases basic configuration and file system interaction in Node.js.
Upgrade to `bwip-js@4.9.2` or higher to incorporate the critical fixes.
For browser, React Native, or generic platform code, migrate to ES Module `import` syntax and ensure your build tooling supports ESM. For Node.js, you can choose between `require()` or `import` based on your project setup and the specific `bwip-js` package used.
Review the 'Annotated Example Drawing Object' in the `bwip-js` wiki (linked in the README) and adjust your custom drawing interface to properly manage the `font.rotate` property when it is passed to the `text()` method.
Upgrade to `bwip-js@4.5.3` or higher if you generate Aztec barcodes, especially when encoding binary or non-ASCII data, to ensure correct and reliable output.
If using ES Modules, ensure `import bwipjs from 'bwip-js';` (for the main package) or `import { namedExport } from '@bwip-js/platform';`. If using CommonJS, use `const bwipjs = require('bwip-js');` for the main package. Do not use `require()` for ESM-only platform packages like `@bwip-js/browser`.In Node.js, use the `@bwip-js/node` package and its `toBuffer()` method for generating PNG buffers. For browser environments, use `@bwip-js/browser` and `toCanvas()` to render to an HTML canvas element. Ensure you are importing the correct platform-specific package for your target environment.
Consult the `bwip-js` documentation or the BWIPP wiki for a complete, case-sensitive list of supported barcode types (BCIDs). Correct the `bcid` parameter to a recognized identifier.
No dependency data recorded yet.