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

vgscode

v1.1.4

Published

Validate Generate Sanitize Code

Downloads

62

Readme

VGSCode

Validate • Generate • Sanitize Code

VGSCode is a lightweight library that allows you to validate, generate, and sanitize various codes. Contributions are very welcome!


Supported Countries & Codes

| Country | Supported Codes | | ---------- | ------------------ | | Kazakhstan | IIN, BIN | | ... | (More coming soon) |


Installation

Install via npm or pnpm:

npm install vgscode

or

pnpm install vgscode

Usage

ES6 Modules

Import the library in your project:

import vgscode from "vgscode";

CommonJS (Legacy)

For CommonJS projects, require the package:

const vgscode = require("vgscode");

Examples

Validation

// Validate BIN and IIN codes
vgscode.vBIN("320243026191"); // true
vgscode.vIIN("320229474023"); // false

Generation

// Generate complete codes by providing a prefix
vgscode.gBIN("320243"); // "320243952485"
vgscode.gIIN("320229"); // "320229980830"

Sanitization

// Remove all whitespace characters from the string
vgscode.sTrimAll("32 0229  4740 21"); // "320229474021"

// Remove all non-digit characters
vgscode.sRemoveNonDigits("320#%2294 74fwef021"); // "320229474021"

// Extract codes from a text
vgscode.sExtractCodes("Some text 320229474021 and more text", 12, vgscode.vBIN); //["320243026191"]

Contributing

Contributions are encouraged! Feel free to submit issues or pull requests on GitHub.


License

VGSCode is released under the MIT License.