Skip to content

thomaschaplin/isin-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

17 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

logo

isin-generator

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).

Usage

npm i @thomaschaplin/isin-generator

Example Usage

CommonJS

const { generateIsin } = require("@thomaschaplin/isin-generator");

console.log(generateIsin());       // random country code, e.g. XS2841269504
console.log(generateIsin("US"));   // fixed country code,  e.g. US0378331005

ES Modules / TypeScript

import { generateIsin } from "@thomaschaplin/isin-generator";

console.log(generateIsin());       // random country code, e.g. XS2841269504
console.log(generateIsin("US"));   // fixed country code,  e.g. US0378331005

API

generateIsin(countryCode?: string): string

Generates 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.

Development

Installation

git clone git@github.com:thomaschaplin/isin-generator.git
cd isin-generator
npm install

Build

npm run build   # compile TypeScript to build/
npm run watch   # compile in watch mode

Tests

npm test                  # run tests
npm run test:coverage     # run tests with coverage report
npm run test:mutation     # run mutation tests

License

MIT


Logo graphic by Skyler B from ClipArtKey.

About

๐Ÿ†” International Securities Identification Number (ISIN) generator

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

 
 
 

Contributors