@adobe/helix-qr-code
Helix QR Code utilities
Last updated 3 months ago by trieloff .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @adobe/helix-qr-code 
SYNC missed versions from official npm registry.

Helix QR Code utilities

A library for generating and decoding QR codes

Status

codecov CircleCI GitHub license GitHub issues LGTM Code Quality Grade: JavaScript Renovate enabled semantic-release

Installation

$ npm install @adobe/helix-qr-code

Usage

Decode a QR code from the raw image file data:

const fs = require('fs');
const qr = require('@adobe/helix-qr-code');

const bytes = fs.readFileSync('image_with_qr_code.jpg');
qr.decodeFromBuffer(bytes).then((decoded) => console.log(decoded));

Encode text as a QR code (raw PNG file data output):

const fs = require('fs');
const qr = require('@adobe/helix-qr-code');

qr.encodeToBuffer('text to be encoded').then((buf) => fs.writeFileSync('qr_code.png', buf)));

Encode text as a QR code (SVG output):

const qr = require('@adobe/helix-qr-code');

qr.encodeToSVG('text to be encoded').then((svg) => console.log(svg)));

Encode text as a QR code (Data URL output):

const qr = require('@adobe/helix-qr-code');

qr.encodeToDataURL('text to be encoded').then((dataURL) => console.log(dataURL)));

See the API documentation for more information.

Development

Build

$ npm install

Test

$ npm test

Lint

$ npm run lint

Current Tags

  • 1.1.1                                ...           latest (3 months ago)

3 Versions

  • 1.1.1                                ...           3 months ago
  • 1.1.0                                ...           7 months ago
  • 1.0.0                                ...           8 months ago

Copyright 2014 - 2016 © taobao.org |