JSPM

qris-dynamic-generator

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q40765F
  • License ISC

Package Exports

  • qris-dynamic-generator
  • qris-dynamic-generator/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (qris-dynamic-generator) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

This is Quick Response Code Indonesian Standard (QRIS) Generator. To use this package, make sure you have a static QRIS, because this package will change your static QRIS to Dynamic.

How to install

This is a Node.js module available through the npm registry.

Before installing, download and install Node.js. Node.js 18.17 or higher is required.

Installation is done using the npm install command:

$ npm install qris-dynamic-generator

Code example

const qrisDynamicGenerator = require("qris-dynamic-generator");

// Put your QRIS code here, you can get it by scanning your QRIS barcode with your native phone camera
const myQRIS = "00020101021126760024ID.CO.SPEEDCASH.MER...";
const QRIS = qrisDynamicGenerator(myQRIS);

// For example I create a function
const main = async () => {
  const QRISNewBarcode = await QRIS.generateBase64(2500, 600);
  console.log(QRISNewBarcode);
}

main();

// the results looks like this
// data:image/png;base64,iVBORw0KGgoAAAANSUhEUgA....

Explanation

In this part you can get your QRIS code by scanning your QRIS barcode with your native phone camera

const myQRIS = "00020101021126760024ID.CO.SPEEDCASH.MER...";

I provide 2 parameters here
the first one is your amount in IDR
the second one is barcode size

const QRISNewBarcode = await QRIS.generateBase64(2500, 600);

I provided the result as base64
so you can directly use it as an image

I also provide another result ( QRIS code )
you can use this method ( with only one parameter )

const QRISNewBarcode = QRIS.generate(2500);