1.0.2 • Published 5 years ago

qr-mon v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

qr-mon

Microservice to create qr data stream in NodeJS with customized design options. npm version

Getting Started

npm install qr-mon --save
var express = require('express');
var app = express();

var qr-mon = require('qr-mon');

app.get('/qr', function(req, res) {
    let error = false;
    let options = req.query;
    let text = req.query.data ? req.query.data : error = true;
    if (!error) {
        var code = qr-mon.generate(text, options);
        res.type('svg');
        res.send(code);
    } else {
        res.status(500);
        res.json({ error: 'Needs text to be encoded' });
    }
});

app.listen(3000, () => console.log('server started.....'));

HTML

<img src="http://localhost:3000/qr?data=my_data">

Options

margin

Margin to be left around the qr code

Type: Integer
Default : 0

background

Background color the qr code

Type: rgb()
Default : transparent

shape

Shape of points inside the body of the qr code

Default : 0, square

OptionImage
0body shape 0 image
1body shape 1 image
2body shape 2 image
3body shape 3 image

eye ball

Shape of inner section of the position markers

Default : 0, square

OptionImage
0eye ball 0 image
1eye ball 1 image
2eye ball 2 image
3eye ball 3 image
4eye ball 4 image
5eye ball 5 image
6eye ball 6 image
7eye ball 7 image
8eye ball 8 image
9eye ball 8 image
rotaryrotary eye ball image

eye frame

Shape of frame of the position markers

Default : 0, square

OptionImage
0eye_frame 0 image
1eye_frame 1 image
2eye_frame 2 image
3eye_frame 3 image
4eye_frame 4 image
5eye_frame 5 image
6eye_frame 6 image
7eye_frame 7 image
8eye_frame 8 image
9eye_frame 9 image

fill

Fill of the qr code

Default : solid

  • solid
  • linear-horizontal
  • linear-vertical
  • radial

color

color of the qr code

Default :
solid : black
gradient : rgb(0,0,0), rgb(2,119,189)

  • solid - rgb / name of color
  • gradient - color1.color2
1. http://localhost:3000/qr?data=my_data&fill=radial&color=red.black

2. http://localhost:3000/qr?data=my_data&fill=radial  (default-fill)
1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago