# qr-node

> NodeJS ES6 wrapper for libqrencode C library written by Kentaro Fukuchi

Latest version **1.0.5** (published 2016-06-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install qr-node
pnpm add qr-node
yarn add qr-node
bun add qr-node
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2016-06-19 |
| First published | 2016-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Sergey Khomushin |
| Maintainers | xr0master |
| Keywords | qr, node, qr, node, libqrencode, Kentaro, Fukuchi, fast, faster, promise |

## Links

- npm: https://www.npmjs.com/package/qr-node
- Repository: https://github.com/xr0master/qr-node
- Issues: https://github.com/xr0master/qr-node/issues
- npm.io page: https://npm.io/package/qr-node

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 1.0.5 (latest) — 2016-06-19
- 1.0.4 — 2016-05-17
- 1.0.3 — 2016-05-17
- 1.0.2 — 2016-05-17
- 1.0.1 — 2016-05-17
- 1.0.0 — 2016-05-17

## README

# qr-node
NodeJS ES6 wrapper for libqrencode C library written by Kentaro Fukuchi (http://fukuchi.org/works/qrencode/index.en.html)

### API
```javascript
static encode(value: string, path?: string, options?: IOptions): Promise<any>
```
where:
* value is your data (up to 7000 digits or 4000 characters)
* path (optional) save your data as file on the path
* options (optional) is options

return: Promise


### How to use

Don't save to file and return Buffer. Used the default options
```javascript
Encoder.encode('myText').then((data) => {
  console.log(data.toString('base64'));
});
```

Don't save to file and return Buffer. Change the background color to transparent and the level to hight
```javascript
Encoder.encode('myText', null, {background_color: '#00000000', level: Levels.HIGH}).then((data) => {
  console.log(data.toString('base64'));
});
```

Save as SVG.
```javascript
Encoder.encode('myText', 'qr.svg', {type: Types.SVG}).then(() => {
  console.log('saved');
});
```

#### IOptions
```javascript
interface IOptions {
  foreground_color?: string; // default: #000000
  background_color?: string; // default: #ffffff
  dot_size?: number; // default: 3
  margin?: number; // default: 4
  level?: string; // default: Levels.LOW
  case_sensitive?: boolean; // default: true
  version?: number; // default: 1
  type?: string; // default: Types.PNG
}
```

#### Levels
```javascript
const Levels = {
  LOW: 'L',
  MEDIUM: 'M',
  QUARTILE: 'Q',
  HIGH: 'H'
};
```

#### Types
```javascript
const Types = {
  PNG: 'PNG',
  EPS: 'EPS',
  SVG: 'SVG',
  ANSI: 'ANSI',
  ANSI256: 'ANSI256',
  ASCII: 'ASCII',
  ASCIIi: 'ASCIIi',
  UTF8: 'UTF8',
  ANSIUTF8: 'ANSIUTF8'
};
```

---
_Source: https://npm.io/package/qr-node · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
