<commit_before>Finnish business id and vat number validator/generator
======================================================

[![Build Status](https://travis-ci.org/vkomulai/finnish-business-ids.svg?branch=master)](https://travis-ci.org/vkomulai/finnish-business-ids) ![0 deps](https://david-dm.org/vkomulai/finnish-business-ids.svg) ![Downloads](https://img.shields.io/npm/dt/finnish-business-ids.svg) ![License](https://img.shields.io/npm/l/finnish-business-ids.svg)

- A micro library for validating and creating Finnish business ids (y-tunnus, alv-numero)
- Lightweight, less than 10kb
- No dependencies

Installation
------------

```sh
# NPM
npm install finnish-business-ids --save

# yarn 
yarn add finnish-business-ids
```

Usage
-----

Node.js

``` js
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)<commit_msg>Add headers to code examples<commit_after>Finnish business id and vat number validator/generator
======================================================

[![Build Status](https://travis-ci.org/vkomulai/finnish-business-ids.svg?branch=master)](https://travis-ci.org/vkomulai/finnish-business-ids) ![0 deps](https://david-dm.org/vkomulai/finnish-business-ids.svg) ![Downloads](https://img.shields.io/npm/dt/finnish-business-ids.svg) ![License](https://img.shields.io/npm/l/finnish-business-ids.svg)

- A micro library for validating and creating Finnish business ids (y-tunnus, alv-numero)
- Lightweight, less than 10kb
- No dependencies

Installation
------------

```sh
# NPM
npm install finnish-business-ids --save

# yarn 
yarn add finnish-business-ids
```

Usage
-----

Node.js

Javascript
``` js
const { FinnishBusinessIds } = require('finnish-business-ids')

const validId = FinnishBusinessIds.isValidBusinessId('2617416-4')
console.log('validId:', validId)
```

Typescript
``` typescript
import { FinnishBusinessIds } from 'finnish-business-ids'

const validId: boolean = FinnishBusinessIds.isValidBusinessId('2617416-4')
console.log('validId:', validId)
{'fraction_non_alphanumeric': 0.20078912757562473, 'fraction_numerical': 0.016659359929855327, 'mean_word_length': 5.217983651226158, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5572276', 'n_tokens_mistral': 828, 'n_tokens_neox': 755, 'n_words': 133}