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

company-id-validator

v1.22.2

Published

A Javascript library to validate company identifiers algorithms for many countries

Readme

Company id validator

This Javascript library helps you to validate and get detailed information for a company/business identifier. It's inspired from this awesome ptdnum python library

| Statements | Branches | Functions | Lines | | --------------------------- | ----------------------- | ------------------------- | ----------------- | | Statements | Branches | Functions | Lines |

Why ?

  • Each country has its own company/business identifier and their name and validation algorithms are very specific from one country to another.
  • It is very difficult to gather information about local company identifiers: For example, do you know the name of the chinese company identifier ? it's format ? How to validate it ?
  • That's the purpose of this library

Demo

You can find a demo here

How to use it

  • npm install company-id-validator --save
  • You can now validate a company identifier based on its country code:
import { CompanyId } from 'company-id-validator';

CompanyId.validate('FR', '802070748'); // Should return true
  • You can also get detailed information:
import { CompanyId } from 'company-id-validator';

const info = CompanyId.info('FR', '802070748');
console.log(info);
{
  "valid": true,
  "query": "802070748",
  "sanitizedQuery": "802070748",
  "countryCode": "FR",
  "name": "SIREN",
  "fullName": "Système d'Identification du Répertoire des Entreprises",
  "type": "LOCAL_COMPANY_ID",
  "description": "The SIREN (Système d'Identification du Répertoire des Entreprises) is a 9\ndigit number used to identify French companies. The Luhn checksum is used\nto validate the numbers.",
  "trustedSourceUrl": "https://fr.wikipedia.org/wiki/Syst%C3%A8me_d%27identification_du_r%C3%A9pertoire_des_entreprises",
  "pattern": "^[0-9]{3}[ \\.\\-]?[0-9]{3}[ \\.\\-]?[0-9]{3}$",
  "parentLevel": true,
  "countryName": "France",
  "id": "802070748",
  "vatNumber": "FR89802070748"
}

Getting started

  • npm install to get node dependencies
  • npm run build to build the application

Tests

Unit tests

  • npm run test to start Jest tests.
  • npm run test:ci to run with coverage:
  • HTML and coverage reports are generated under the dist/test-results/html and dist/test-results/lcov-report folders.

Code quality

npm run lint. Will check your code based on .eslintrc.json config file

Roadmap

  • For now 15 countries are supported: AD, AL, AT, BE, CH, CN, DE, ES, FR, GB, IT, NI, NO, PL, SC, SE, JP
  • Need to add many more countries based on the ptdnum python library