isin-generator is a Node.js library to generate random valid ISINs.
An International Securities Identification Number (ISIN) is a code that uniquely identifies a specific securities issue. The organization that allocates ISINs in any particular country is the country's respective National Numbering Agency (NNA).
npm i @thomaschaplin/isin-generator
const { generateIsin } = require("@thomaschaplin/isin-generator");
console.log(generateIsin()); // random country code, e.g. XS2841269504
console.log(generateIsin("US")); // fixed country code, e.g. US0378331005import { generateIsin } from "@thomaschaplin/isin-generator";
console.log(generateIsin()); // random country code, e.g. XS2841269504
console.log(generateIsin("US")); // fixed country code, e.g. US0378331005Generates a valid 12-character ISIN. Optionally accepts an ISO 3166-1 alpha-2 country code to fix the country prefix. The country code is case-insensitive. If omitted, a country code is chosen at random.
git clone git@github.com:thomaschaplin/isin-generator.git
cd isin-generator
npm installnpm run build # compile TypeScript to build/
npm run watch # compile in watch modenpm test # run tests
npm run test:coverage # run tests with coverage report
npm run test:mutation # run mutation tests