Demonstration - QRCode

Capable of containing virtually any data desired.
Popular for its use in mobile tagging and data sharing.
Can contain large amounts of data and can be spread throughout multiple barcodes.
Micro and Standard versions can be used to vary the size of the barcode.
* 30 character limit for this demo.
'use strict';

import { createServer } from 'http';
import { BCGColor, BCGDrawing, createSurface, toBuffer } from '@barcode-bakery/barcode-nodejs';
import { BCGqrcode } from '@barcode-bakery/barcode-nodejs/qrcode';

http.createServer(function (request, response) {
    const colorBlack = new BCGColor(0, 0, 0);
    const colorWhite = new BCGColor(255, 255, 255);

    // Barcode Part
    const code = new BCGqrcode();
    code.setScale(2); // Resolution
    code.setForegroundColor(colorBlack); // Color of bars
    code.setBackgroundColor(colorWhite); // Color of spaces

    // Drawing Part
    const drawing = new BCGDrawing(createSurface);
    toBuffer(drawing, BCGDrawing.ImageFormat.Png, function (err, buffer) {
        response.writeHead(200, { "Content-Type": "image/png" });