New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

nusantara-valid

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nusantara-valid

Nusantara Valid is a data validator to validate any Indonesian specific civil data such as nik, nip, and many more.

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
29
Maintainers
1
Weekly downloads
 
Created
Source

Nusantara Valid

Nusantara Valid is a data validator to validate any Indonesian specific civil data such as nik, nip, and many more.

Table of contents

  • What it can do?
  • Getting started
  • Usage
  • API
  • Creators
  • License

What it can do?

  • ATM Number (Nomor Rekening)
  • Cellular Number / Mobile Number
  • Credit Card Number
  • E-Mail
  • NIK (Nomor Induk Kependudukan)
  • NIP (Nomor Induk Pegawai Negeri Sipil)
  • NISN (Nomor Induk Siswa Nasional)
  • NPWP (Nomor Pokok Wajib Pajak)
  • TNKB (Tanda Nomor Kendaraan Bermotor)
  • Telephon Number
  • Zip Code

Getting started

  • Download the latest release.

  • Clone the repo:

    git clone https://github.com/magicjar/nusantara-valid.git

  • Install with npm:

    npm install nusantara-valid

The package includes multiple formats to support different process.

  • nusantara-valid.cjs.js - CommonJS module.
  • nusantara-valid.es.mjs - ES module.
  • nusantara-valid.umd.js - UMD module. Can be used with good-usual-way script tag

Usage

CommonJS module way (require())

const NusantaraValid = require('nusantara-valid')

ES module way (import)

import NusantaraValid from './node_modules/nusantara-valid/dist/nusantara-valid.es.mjs'

Good-usual-way (<script></script>)

<script src="../dist/nusantara-valid.umd.js"></script>

API

ATM Number (Nomor Rekening)

isValidATMNumber(rek: string, bank?: string);
isValidATMNumber('87.800.000.00');
isValidATMNumber('1230005123000', 'MDRK');

Bank

getBankData();

Cellular Number (Nomor HP)

isValidCellularNumber(cel: string);
isValidCellularNumber('081212341234');

Credit Card Number

isValidCCNumber(cc: string);
isValidCCNumber('4000123456789010');
isValidCCNumber('5000 1234 5678 9010');

formatCCNumber(cc: string);
formatCCNumber('4000123456789010');
formatCCNumber('5000 1234 5678 9010');

E-Mail

isValidEmail(email: string);
isValidEmail('myawesom-email@domain.tld');

Nomor Induk Kependudukan (NIK)

isValidNIK(nik: string | number);
isValidNIK('3101011212930001');
isValidNIK(3101011212930001);

Nomor Induk Pegawai Negeri Sipil (NIP)

isValidNIP(nip: string);
isValidNIP('198512262000051001');

Nomor Induk Siswa Nasional (NISN)

isValidNISN(nisn: string);
isValidNISN('0061230001');

Nomor Pokok Wajib Pajak (NPWP)

isValidNPWP(npwp: string);
isValidNPWP('09.123.123.1-123.123');
isValidNPWP('091231231123123');

formatNPWP(npwp: string | number, pad?: true); // xx.xxx.xxx.x-xxx.xxx
formatNPWP('091231231123123');
formatNPWP(671231231123123, false);

Province

getProvinceData();

Tanda Nomor Kendaraan Bermotor (TNKB)

isValidTNKB(tnkb: string);
isValidTNKB('AB1234XYZ');

Telephone Number (Nomor Telefon)

isValidTelephoneNumber(tel: string);
isValidTelephoneNumber('0274123123');

ZIP Code (Kode POS)

isValidZIP(zip: string | number);
isValidZIP('55524');
isValidZIP(55524);

Creators

Fajar Setya Budi

License

Nusantara Valid released under the MIT License

Keywords

FAQs

Package last updated on 29 Jun 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc