New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

hkid-utils

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hkid-utils

A library to handle Hong Kong ID card number

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

hkid-utils

A JavaScript toolkit to handle Hong Kong Identity Card (HKID) numbers, validate and generate random HKID numbers.

Features 🤖

  • Validate HKID number
    • Supports brackets! ()
    • No matter what case aAbC
  • Generate Random HKID

Installation 📦

npm install hkid-utils

or

yarn add hkid-utils

NPM Package 📦

Usage

const hkidUtils = require('hkid-utils');

// Validate HKID number
hkidUtils.validate('G123456(A)'); // true
hkidUtils.validate('aB987654(3)'); // true
hkidUtils.validate('X3459387'); // true

hkidUtils.validate('123(A)4') // false

// Generate random HKID number
hkidUtils.random(); // 'A123456(7)'

Todo ✅

  • Main Features

    • Validate HKID number
    • Generate random HKID number
      • with "includeBrackets" option
  • DevOps

    • GitHub Actions pipeline to release package to NPM
  • Compatibility

    • ES5 (NodeJS)
    • ES6 (Browser)

Contribution guidelines 📝

Your contributions are always welcome! Even if it's just a typo or a missing comma, we'll appreciate it.

  • Fork the repository 🍴
  • Create a branch with your feature or bug fix 🎋
  • Commit your changes 💽
  • Create a pull request 🧰

Keywords

hkid

FAQs

Package last updated on 14 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts