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 🙏

© 2026 – Pkg Stats / Ryan Hefner

sg-paynow-qr

v1.1.3

Published

Generates qr string for making sg paynow payments

Downloads

19

Readme

Developer Documentation

Basic Gitlab NPM package

This is a test module for learning basics to publishing a Javascript/Typescript module to NPM registry to share and reuse cide.

This is initially based on the article from snyk.

It's reference code can be found here.

Changes:

  • Use Jest for testing instead of Mocha
  • Use Gitlab CI instead of Github Actions.
  • Use nodejs-scan and semgrep SAST provided by Gitlab

Prerequisites to setup:

  • Gitlab account with 2FA
  • Gitlab personal access token with API, read_repository and write_repository permissions
  • NPM token for publishing to npmjs registry.

Quick start

This section outlines the overall steps to configure up your name project. Details of individual steps could be found on next section.

On Gitlab CI web console.

  • Create empty Gitlab project with your desired namespace and project name.
  • Add the following environment variables.
    • GL_TOKEN = ******
    • NPM_TOKEN = ******
    • DRYRUN = true
    • COMMIT_LINT_DEPTH = 1

On your local repository clone.

  • Update references to kaikokchew namespace with your own.
  • Update references to sg-paynow-qr project name with your own.
  • Update NPM cache to local folder.
  • Perform an NPM install.
  • Perform a docker build of runner container image.
  • Push container image of runner into the Gitlab CI registry.
  • Update origin of this repo with your Gitlab project.
  • Push this baseline into your Gitlab repo.

The pipeline should trigger from this push into the Gitlab repository.

Detailed Steps

Set npm cache to local

Docker build will rely on this to speed up

npm config set cache .npm

Install all dependencies and setup commit hook

npm install

Running linters

To perform a check

npm run lint

To Auto fix as much as possible.

npm run lint-fix

Check on commit message format

npx commitlint --from=HEAD

Running unit tests

For local run.

npm run test

For running tests in Gitlab CI.

npm run test:ci

Docker image for test and publish in Gitlab CI/CD

Building and updating image on Gitlab registry.

docker login registry.gitlab.com
docker build -t registry.gitlab.com/kaikokchew/sg-paynow-qr/runner:latest --build-arg GL_PROJ_GROUP=kaikokchew --build-arg GL_PROJ_NAME=sg-paynow-qr --progress=plain .
docker push registry.gitlab.com/kaikokchew/sg-paynow-qr/runner:latest

Running and testing image on local.

docker run -it -v $(pwd):/builds/kaikokchew/sg-paynow-qr --rm registry.gitlab.com/kaikokchew/sg-paynow-qr/runner sh

Configuring pre-commit hooks

Typically this is already done as part of first time npm installation.

npm install --save-dev husky
npm pkg set scripts.commitlint="commitlint --edit"
echo "npm run commitlint \${1}" > .husky/commit-msg
npm pkg set scripts.pre-commit="npm run lint"
echo "npm run pre-commit \${1}" > .husky/pre-commit

Building your package

npm run build