npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node_paynowsg

v0.1.3

Published

testing again

Downloads

5

Readme

PayNow QR Generator

This project will allow you to generate dynamic QR codes which are compatible with PayNow standards. There are two major steps in the creation of a PayNow QR Code

  1. Generation of a string based on the relevant inputs
  2. Encoding this string into a QR code

PayNow QR codes can be scanned using the banking application of any participating bank in Singapore (most of them). This generator will allow you to create these QR codes with information such as payment amount, destination account, and other bits of information required for reconciliation afterward (e.g. merchant name, additional comments) There are two files of note in this repo.

  • PayNowCLI - Useful if you want a quick demo of what fields are relevant for the generation of a QR code, or if you want to generate a single QR code.
  • QRGenerator - Full set of code with the encoding logic for the QR code included

If you're just looking for a simple function to generate your code, without having to mess around with the QRGenerator file, I've exposed the functionality as a package over at https://www.npmjs.com/package/paynow-generator and you can find more information about how to use it there.

Do note that some of the fields are hardcoded for Singapore, but I hardly see that as an issue in the short term. I've also hardcoded certain fields such as expiry date just for this initial run, and I'll get around to fixing that later.

The PayNow QR encoding format is governed by standards laid out by EMVCo - and you can find that documentation here as well.

PayNowCLI

node QRGeneratorCLI.js

This should bring up a CLI information where you can navigate the fields required to generate a basic QR code step by step. It's a good way to get a sense of what goes into the QR code. Generated files can be found in the QR-Output folder as test.png. You can test them by scanning it with your preferred PayNow compatible QR code scanner.

This uses the QRGenerator file with a CLI built on top using the Inquirer package.

PaynowGenerator Package

Usage details can be found over at https://www.npmjs.com/package/paynow-generator

This exposes the QR encoding as a single function, giving you plenty of flexibility to generate QR codes en masse, or whatever tickles your fancy. This package does not include the functionality of encoding the string into a QR code. If you're using this package I'd assume you'll want more control over the QR outputs anyway.

PaynowGenerator

This file is really only useful if you'd like to understand the encoding process in detail and/or modify it to suit your needs. The QRGeneratorCLI file is build on top of this. If you'd just like to bake the string generation logic into your application, you can just use the packaged version.