- A micro library for validating and creating Finnish business ids (y-tunnus, alv-numero)
- Lightweight, less than 10kb
- No dependencies
- Written in Typescript, typescript types available out-of-the-box
# NPM
npm install finnish-business-ids --save
# yarn
yarn add finnish-business-ids
Node.js
Javascript
const { FinnishBusinessIds } = require('finnish-business-ids')
const validId = FinnishBusinessIds.isValidBusinessId('2617416-4')
console.log('validId:', validId)
Typescript
import { FinnishBusinessIds } from 'finnish-business-ids'
const validId: boolean = FinnishBusinessIds.isValidBusinessId('2617416-4')
console.log('validId:', validId)
- Validates parameter given business id (y-tunnus), format: 1234567-8
- Validates parameter given Finnish vat number (alv-numero), format: FI12345678
- Generates a random Finnish business id
- Generates a random Finnish vat number
- Calculates checksum for parameter given business id without checksum, format: 1234567
# Build a distributable minified library
npm run dist
# Run linter
npm run lint
# Run tests
npm run test
npm run dist
- Update version number in
package.json
. Follow semantic versioning npm publish