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

gb-util

v1.0.6

Published

GB standard tool library

Downloads

4

Readme

GB Utilities

gb-util is a toolset for Chinese standards. It supports: GB 11643, GB 11714, GB 32100, GB/T 2260, GB/T 17710, ISO 7064.

NPM version NPM downloads Build Status Coverage Status Dependency Status

Install

$ npm install gb-util

Usage

import {
  GB_11643,
  GB_11714,
  GB_32100,
  GB_T_2260,
  GB_T_17710,
  GB_T_5795,
  ISO_7064
} from 'gb-util';

GB_11643.compute('11010519491231002'); // => 'X'
GB_11643.isValid('11010519491231002X'); // => true
GB_11643.parse('11010519491231002X');
// => { areaCode: '110105', birth: '1949-12-31', order: 2, sex: 0 }

GB_11714.compute('D2143569'); // => 'X'
GB_11714.isValid('D2143569X'); // => true

GB_32100.compute('91350100M000100Y4'); // => '3'
GB_32100.isValid('91350100M000100Y43'); // => true
GB_32100.parse('91350100M000100Y43');
// => { adminDept: '工商', areaCode: '350100', id: 'M000100Y4', type: '企业' }

GB_T_2260.getAreaName('110000'); // => '北京市'
GB_T_2260.getAreaCode('北京市'); // => ['110000']
GB_T_2260.isRevoked('372401'); // => true
GB_T_2260.getUsedNames('220281'); // => ['蛟河市', '桦甸市']
GB_T_2260.getArea('110105');
/* => {
  code: '110105',
  name: '朝阳区',
  province: '北京市',
  city: '北京市',
  county: '朝阳区',
  revoked: false,
  usedNames: []
} */
GB_T_2260.getAreaTree();
// => [{ code: '130000', name: '河北省', children: [...] }, ...]
GB_T_2260.getProvinces();
// => [{ code: '110000', name: '北京市' }, ...]
GB_T_2260.getCities('130000');
// => [{ code: '130100', name: '石家庄市' }, ...]
GB_T_2260.getCounties('130100');
// => [{ code: '130102', name: '长安市' }, ...]

// Pure systems
ISO_7064.mod11_2('0794'); // => '0'
ISO_7064.mod37_2('1234ABCD'); // => 'V'
ISO_7064.mod97_10('794'); // => '44'
ISO_7064.mod661_26('ABCD'); // => 'KN'
ISO_7064.mod1271_36('ISO79'); // => '3W'
// Hybrid systems
ISO_7064.mod11_10('0794'); // => '5'
ISO_7064.mod27_26('JEJLMGJ'); // => 'S'
ISO_7064.mod37_36('B7Q3SFTUSH2QN7BIXBPMNZAM'); // => 'I'


GB_T_5795.compute('978-4-87311-336-4'); // => 4
GB_T_5795.isValid('978-4-87311-336-4'); // => true
GB_T_5795.parse('9784873113364');
/* => {
  isIsbn10: false,
  isbn10: '4873113369',
  isbn13: '9784873113364',
  prefix: '978',
  group: '4',
  groupName: 'Japan',
  publisher: '87311',
  article: '336',
  isbn10h: '4-87311-336-9',
  isbn13h: '978-4-87311-336-4'
} */

Documents

Read full documents

Report a issue

License

gb-util is available under the terms of the MIT License.