{"_id":"vat-validation","_rev":"4-de7a1a479f7ac0aa99b503cc1ed45718","name":"vat-validation","dist-tags":{"latest":"3.0.0","beta":"3.0.0-beta.3"},"versions":{"3.0.0-beta.1":{"name":"vat-validation","version":"3.0.0-beta.1","keywords":["vat-validation","EU","vat","VAT","VATIN","european","euro","value","added","check","syntax","validator","VAT Code validator","validator","finance","tax"],"author":"","license":"MIT","_id":"vat-validation@3.0.0-beta.1","maintainers":[{"name":"lkpch","email":"npm_lkpch@lxkp.top"}],"contributors":[{"url":"http://wilgert.nl","name":"Wilgert Velinga","email":"wilgert@wilgert.nl"}],"dist":{"shasum":"9c82d1f3a6ef0b10bbb1ebafa96beaaa0b1cdb3b","tarball":"https://registry.npmjs.org/vat-validation/-/vat-validation-3.0.0-beta.1.tgz","fileCount":9,"integrity":"sha512-rbqkFdgH/s35OzB3WkLDRo7cSQxHvkm3r9BZ4UYjv+J+WCwE8IGMUWbr5azkaWBy/GQlAxVrtzj72LhkDM1FwA==","signatures":[{"sig":"MEQCIC8gNzsgMZONRwCh14sNcpj4Nfckxb87lNNzO4MYd+NVAiBl9PcFhYluoOJ0ltXuLBZyUJ7+PNkWjSs33nBCReNIqw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":246510},"main":"./dist/index.cjs","types":"./dist/index.d.ts","ignore":{},"module":"./dist/index.mjs","engines":{"node":">=24"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"gitHead":"66233013c80785548f141db643ca42bd74fb18b1","private":false,"scripts":{"lint":"eslint src/ && tsc --noEmit","test":"jest","build":"tsup","prepare":"husky","prettier":"prettier --write 'src/**/*.ts'","typecheck":"tsc --noEmit","prepublishOnly":"yarn test && yarn build","prettier:check":"prettier --check 'src/**/*.ts'"},"_npmUser":{"name":"lkpch","email":"npm_lkpch@lxkp.top"},"_npmVersion":"11.9.0","description":"Check the validity of a VAT number","directories":{},"_nodeVersion":"24.14.0","dependencies":{},"_hasShrinkwrap":false,"packageManager":"yarn@1.22.22","devDependencies":{"jest":"30.2.0","tsup":"8.5.1","husky":"9.1.7","eslint":"9.39.3","ts-jest":"29.4.0","prettier":"3.8.1","typescript":"5.9.3","@types/jest":"30.0.0","pretty-quick":"4.2.2","typescript-eslint":"8.56.1","eslint-config-prettier":"10.1.8"},"_npmOperationalInternal":{"tmp":"tmp/vat-validation_3.0.0-beta.1_1772445840724_0.844868136761799","host":"s3://npm-registry-packages-npm-production"}},"3.0.0-beta.2":{"name":"vat-validation","version":"3.0.0-beta.2","keywords":["vat-validation","EU","vat","VAT","VATIN","european","euro","value","added","check","syntax","validator","VAT Code validator","validator","finance","tax"],"author":"","license":"MIT","_id":"vat-validation@3.0.0-beta.2","maintainers":[{"name":"lkpch","email":"npm_lkpch@lxkp.top"}],"contributors":[{"url":"http://wilgert.nl","name":"Wilgert Velinga","email":"wilgert@wilgert.nl"}],"dist":{"shasum":"316eb29252f87458e4d43377b7b1a1a22f76d129","tarball":"https://registry.npmjs.org/vat-validation/-/vat-validation-3.0.0-beta.2.tgz","fileCount":9,"integrity":"sha512-I2CwohW3nh6M7IfYzarw6iQ+PvhDEmOjcuQiGuwv+QEsYjD3vsQw7bszKUhrk14t32xFQdaYELpEGyReLCJA4Q==","signatures":[{"sig":"MEUCIQCeLyDUkEsTqnW/XkOcGHAVtGJon5r5RZR81jWJ9z1O+QIgM98cmf9U3oXwLwB9xf+S0uqFqn1NMTTPwK/LUFe4imY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":246511},"main":"./dist/index.cjs","types":"./dist/index.d.ts","ignore":{},"module":"./dist/index.mjs","engines":{"node":">=24"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"gitHead":"66233013c80785548f141db643ca42bd74fb18b1","private":false,"scripts":{"lint":"eslint src/ && tsc --noEmit","test":"jest","build":"tsup","prepare":"husky","prettier":"prettier --write 'src/**/*.ts'","typecheck":"tsc --noEmit","prepublishOnly":"yarn test && yarn build","prettier:check":"prettier --check 'src/**/*.ts'"},"_npmUser":{"name":"lkpch","email":"npm_lkpch@lxkp.top"},"_npmVersion":"11.9.0","description":"Check the validity of a VAT number","directories":{},"_nodeVersion":"24.14.0","dependencies":{},"_hasShrinkwrap":false,"packageManager":"yarn@1.22.22","readmeFilename":"README.md","devDependencies":{"jest":"30.2.0","tsup":"8.5.1","husky":"9.1.7","eslint":"9.39.3","ts-jest":"29.4.0","prettier":"3.8.1","typescript":"5.9.3","@types/jest":"30.0.0","pretty-quick":"4.2.2","typescript-eslint":"8.56.1","eslint-config-prettier":"10.1.8"},"_npmOperationalInternal":{"tmp":"tmp/vat-validation_3.0.0-beta.2_1772538833468_0.09377957086580135","host":"s3://npm-registry-packages-npm-production"}},"3.0.0-beta.3":{"name":"vat-validation","version":"3.0.0-beta.3","keywords":["vat-validation","EU","vat","VAT","VATIN","european","euro","value","added","check","syntax","validator","VAT Code validator","validator","finance","tax"],"author":"","license":"MIT","_id":"vat-validation@3.0.0-beta.3","maintainers":[{"name":"lkpch","email":"npm_lkpch@lxkp.top"}],"contributors":[{"url":"http://wilgert.nl","name":"Wilgert Velinga","email":"wilgert@wilgert.nl"}],"dist":{"shasum":"e98c88b4c32acf0f419b3a2c8861c32af8023447","tarball":"https://registry.npmjs.org/vat-validation/-/vat-validation-3.0.0-beta.3.tgz","fileCount":9,"integrity":"sha512-J6nA/LTRIvONnrsBrOly9q95lSdM0QwbIdvUjg2e8cKTmdP5fsdqq2lYyb69QNHCS2SY9qCUNUCVSfwxahgnmg==","signatures":[{"sig":"MEQCIE+VE6DtTtmcnpgREIW7Ve3MS4QkXZ9dSfY2+2bdJ9AdAiBxrwgoYoKwOnRESl6joer92LPx59YuLhKi9FGCB4fHkw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":246677},"main":"./dist/index.cjs","types":"./dist/index.d.ts","ignore":{},"module":"./dist/index.mjs","engines":{"node":">=24"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"gitHead":"a7a05786f19c1503da219711b60f68cdd15bb6d6","private":false,"scripts":{"lint":"eslint src/ && tsc --noEmit","test":"jest","build":"tsup","prepare":"husky","prettier":"prettier --write 'src/**/*.ts'","typecheck":"tsc --noEmit","prepublishOnly":"yarn test && yarn build","prettier:check":"prettier --check 'src/**/*.ts'"},"_npmUser":{"name":"lkpch","email":"npm_lkpch@lxkp.top"},"_npmVersion":"11.9.0","description":"Check the validity of a VAT number","directories":{},"_nodeVersion":"24.14.0","dependencies":{},"_hasShrinkwrap":false,"packageManager":"yarn@1.22.22","readmeFilename":"README.md","devDependencies":{"jest":"30.2.0","tsup":"8.5.1","husky":"9.1.7","eslint":"9.39.3","ts-jest":"29.4.0","prettier":"3.8.1","typescript":"5.9.3","@types/jest":"30.0.0","pretty-quick":"4.2.2","typescript-eslint":"8.56.1","eslint-config-prettier":"10.1.8"},"_npmOperationalInternal":{"tmp":"tmp/vat-validation_3.0.0-beta.3_1773151110076_0.017696926071439245","host":"s3://npm-registry-packages-npm-production"}},"3.0.0":{"name":"vat-validation","version":"3.0.0","description":"Check the validity of a VAT number","main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"scripts":{"build":"tsup","prettier":"prettier --write 'src/**/*.ts'","prettier:check":"prettier --check 'src/**/*.ts'","typecheck":"tsc --noEmit","test":"jest","lint":"eslint src/ && tsc --noEmit","prepublishOnly":"yarn test && yarn build","prepare":"husky"},"license":"MIT","keywords":["vat-validation","EU","vat","VAT","VATIN","european","euro","value","added","check","syntax","validator","VAT Code validator","validator","finance","tax"],"ignore":{},"author":"","contributors":[{"name":"Wilgert Velinga","email":"wilgert@wilgert.nl","url":"http://wilgert.nl"}],"private":false,"dependencies":{},"devDependencies":{"@types/jest":"30.0.0","eslint":"9.39.3","eslint-config-prettier":"10.1.8","husky":"9.1.7","jest":"30.3.0","prettier":"3.8.1","pretty-quick":"4.2.2","ts-jest":"29.4.9","tsup":"8.5.1","typescript":"5.9.3","typescript-eslint":"8.58.1"},"engines":{"node":">=24"},"packageManager":"yarn@1.22.22","gitHead":"97d7991b5f7ed497a067b15cd4e6074ef85a0db2","_id":"vat-validation@3.0.0","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-ZLWm10HYJIBiLsMoPme/gxveslXplkrpkL507csIMTSrYdrNgTVe02LoJmfsxgXWS0QghKHedYQZjY/O6wfHSA==","shasum":"1e28686ebabb1c99f0bfbf4f0622c88a0a951919","tarball":"https://registry.npmjs.org/vat-validation/-/vat-validation-3.0.0.tgz","fileCount":9,"unpackedSize":246646,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDiLxDza7+n54c9EjWer+tnrxQs7Z+PArnwFPag4AZA8wIgMsk0161XmVypq2eJPNeB0PzkygbK9KhW1r6ftAbxgCc="}]},"_npmUser":{"name":"lkpch","email":"npm_lkpch@lxkp.top"},"directories":{},"maintainers":[{"name":"lkpch","email":"npm_lkpch@lxkp.top"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/vat-validation_3.0.0_1775638180780_0.5160197909125008"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-02T10:04:00.723Z","modified":"2026-04-08T08:49:41.072Z","3.0.0-beta.1":"2026-03-02T10:04:00.867Z","3.0.0-beta.2":"2026-03-03T11:53:53.630Z","3.0.0-beta.3":"2026-03-10T13:58:30.220Z","3.0.0":"2026-04-08T08:49:40.956Z"},"license":"MIT","keywords":["vat-validation","EU","vat","VAT","VATIN","european","euro","value","added","check","syntax","validator","VAT Code validator","validator","finance","tax"],"description":"Check the validity of a VAT number","contributors":[{"name":"Wilgert Velinga","email":"wilgert@wilgert.nl","url":"http://wilgert.nl"}],"maintainers":[{"name":"lkpch","email":"npm_lkpch@lxkp.top"}],"readme":"[![npm version](https://badge.fury.io/js/vat-validation.svg)](http://badge.fury.io/js/vat-validation)\n\n## vat-validation\n\nCheck the validity of a VAT number. No dependencies.\n\nFork of [jsvat](https://se-panfilov.github.io/jsvat/).\n\n## What is it?\n\nSmall library to check validity of VAT numbers (European + some other countries). ([learn more][1] about VAT)\n\n- No dependencies;\n- No http calls;\n- 2-step checks: math + regexp;\n- Tree-shakeable;\n- Extendable;\n- Separate checks for valid VAT and valid VAT format;\n- Dynamically add/remove countries with which you want to check the VAT;\n- Detecting possible country before you finish;\n- Typescript;\n\n## Installation\n\nInstallation:\n\n```bash\nnpm i vat-validation --save\n```\n\n(or `yarn add vat-validation`)\n\n## Getting Started\n\n```javascript\nimport { checkVAT, belgium, austria } from 'vat-validation';\n\ncheckVAT('BE0411905847', [belgium]); // true: accept only Belgium VATs\ncheckVAT('BE0411905847', [belgium, austria]); // true: accept only Belgium or Austria VATs\ncheckVAT('BE0411905847', [austria]); // false: accept only Austria VATs\n```\n\nor\n\n```javascript\nimport { checkVAT, countries } from 'vat-validation';\ncheckVAT('BE0411905847', countries); // check against all supported countries\n```\n\nto check against all supported countries\n\n## Return value\n\n`checkVAT()` returns `VatCheckResult` object:\n\n```typescript\nexport interface VatCheckResult {\n  value?: string; // 'BE0411905847': your VAT without extra characters (like '-', spaces, etc)\n  isValid: boolean; // The main result. Indicates if VAT is correct against provided countries or not\n  isValidFormat: boolean; // Indicates the validation of the format of VAT only. E.g. \"BE0411905847\" is a valid VAT, and \"BE0897221791\" is not. But they both has valid format, so \"isValidFormat\" will return \"true\"\n  isSupportedCountry: boolean; // Indicates if \"vat-validation\" could recognize the VAT. Sometimes you want to understand - if it's an invalid VAT from supported country or from an unknown one\n  country?: {\n    // VAT's country (null if not found). By \"supported\" I mean imported.\n    name: string; // ISO country name of VAT\n    isoCode: {\n      // Country ISO codes\n      short: string;\n      long: string;\n      numeric: string;\n    };\n  };\n}\n```\n\n## Strict mode\n\nBy default, `checkVAT` is lenient — it strips spaces, dashes, dots, and slashes before validating. If you want to validate the raw input as-is (only uppercasing is applied), pass the `strict` option:\n\n```javascript\ncheckVAT('BE 0411.905.847', [belgium]); // isValid: true (lenient, extra chars stripped)\ncheckVAT('BE 0411.905.847', [belgium], { strict: true }); // isValid: false (spaces and dots not stripped)\ncheckVAT('BE0411905847', [belgium], { strict: true }); // isValid: true\n```\n\n## List of supported countries:\n\n- Andorra\n- Australia\n- Austria\n- Belgium\n- Brazil\n- Bulgaria\n- Croatia\n- Cyprus\n- Czech Republic\n- Denmark\n- Estonia\n- Europe (EU MOSS scheme)\n- Finland\n- France\n- Germany\n- Greece\n- Hungary\n- Ireland\n- Italy\n- Latvia\n- Lithuania\n- Luxembourg\n- Malta\n- Netherlands\n- Norway\n- Poland\n- Portugal\n- Romania\n- Russia Federation\n- Serbia\n- Singapore\n- Slovakia Republic\n- Slovenia\n- Spain\n- Sweden\n- Switzerland\n- United Kingdom (incl. Northern Ireland XI prefix)\n\n## How to import all countries at once?\n\n```javascript\nimport { checkVAT, countries } from 'vat-validation';\n// const { checkVAT, countries } = require('vat-validation');\n\ncheckVAT('WD12345678', countries);\n```\n\n## Extend countries list - add your own country:\n\nYou can add your own country.\nIn general `Country` should implement following structure:\n\n```typescript\ninterface Country {\n  name: string;\n  codes: ReadonlyArray<string>;\n  calcFn: (vat: string, options?: object) => boolean; //options - isn't a mandatory param\n  rules: {\n    multipliers: {}; // you can leave it empty\n    regex: ReadonlyArray<RegExp>;\n  };\n}\n```\n\nExample:\n\n```javascript\nimport { checkVAT } from 'vat-validation';\n\nexport const wonderland = {\n  name: 'Wonderland',\n  codes: ['WD', 'WDR', '999'], // This codes should follow ISO standards (short, long and numeric), but it's your own business\n  calcFn: (vat) => {\n    return vat.length === 10;\n  },\n  rules: {\n    regex: [/^(WD)(\\d{8})$/]\n  }\n};\n\ncheckVAT('WD12345678', [wonderland]); // true\n```\n\n## Module formats\n\nvat-validation ships both ESM and CommonJS builds:\n\n```javascript\n// ESM\nimport { checkVAT, belgium, austria } from 'vat-validation';\n\n// CommonJS\nconst { checkVAT, belgium, austria } = require('vat-validation');\n```\n\n## How vat-validation checks validity?\n\nThere is a 2-step check:\n\n1. **Format validation** — compare against a list of regular expressions.\n\nFor example, the regexp for Austria is `/^(AT)U(\\d{8})$/`.\n`ATU99999999` satisfies the regexp, but it should actually be invalid.\n\n2. **Check digit validation** — verify the number's built-in check digit(s).\n\nMost VAT numbers contain one or more check digits calculated using a country-specific algorithm (weighted sums, modular arithmetic, etc.). This step catches numbers that look right but are mathematically invalid.\nAfter this step we can be sure that `ATU99999999` and `ATV66889218` are invalid, while `ATU12011204` is valid.\n\nNOTE:\nVAT numbers of some countries should ends up with special characters. Like '01' for Sweden or \"L\" for Cyprus.\nIf 100% real VAT doesn't fit, try to add proper appendix.\n\n## Browser Support\n\nEvergreen browsers only.\n","readmeFilename":"README.md"}