3.0.11 • Published 2 years ago

@adriantombu/siret-to-vat v3.0.11

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

SIREN/SIREN to VAT number

npm version npm.io

This small library converts a French SIREN or SIRET to a valid VAT number. You can then use the vat number library to check it against the official European records.

How to use it

  • Install the library first with yarn add @adriantombu/siret-to-vat
  • And then import it in your script
const { convertToVatNumber } = require('@adriantombu/siret-to-vat')

const siren = 817871668
const vat = convertToVatNumber(siren)

{
  vatNumber: "FR16817871668",
  valid: true
}

In case of an invalid number, you will receive the following result, with the value valid set to false

const { convertToVatNumber } = require('@adriantombu/siret-to-vat')

const siren = 123456'
const vat = convertToVatNumber(siren)

{
  vatNumber: 123456',
  message: 'The number provided must be a SIREN (9 caracters) or SIREN (14 caracters)',
  valid: false
}

How to contribute

  • Clone the repository git clone git@github.com:adriantombu/siret-to-vat.git
  • Install the packages with yarn install
  • Modify the src/index.ts file
  • When everything's done, you can send a PR \o/
3.0.11

2 years ago

3.0.10

5 years ago

3.0.9

5 years ago

3.0.8

5 years ago

3.0.7

5 years ago

3.0.6

5 years ago

3.0.4

5 years ago

3.0.3

6 years ago

3.0.2

6 years ago

3.0.1

6 years ago

3.0.0

6 years ago

2.0.8

6 years ago

2.0.7

6 years ago

2.0.6

6 years ago

2.0.5

6 years ago

2.0.4

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

0.0.1

8 years ago