{"id":25543934,"url":"https://github.com/dimitrinicolas/text-mask-vat-id","last_synced_at":"2025-04-11T18:10:50.586Z","repository":{"id":55858114,"uuid":"174860678","full_name":"dimitrinicolas/text-mask-vat-id","owner":"dimitrinicolas","description":"Text Mask for VAT identification number","archived":false,"fork":false,"pushed_at":"2020-12-11T02:51:12.000Z","size":610,"stargazers_count":5,"open_issues_count":10,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T11:48:31.332Z","etag":null,"topics":["text-mask","tva","vat"],"latest_commit_sha":null,"homepage":"https://dimitrinicolas.github.io/text-mask-vat-id/example/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dimitrinicolas.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-10T18:00:35.000Z","updated_at":"2023-08-18T14:39:52.000Z","dependencies_parsed_at":"2022-08-15T08:00:15.671Z","dependency_job_id":null,"html_url":"https://github.com/dimitrinicolas/text-mask-vat-id","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimitrinicolas%2Ftext-mask-vat-id","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimitrinicolas%2Ftext-mask-vat-id/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimitrinicolas%2Ftext-mask-vat-id/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimitrinicolas%2Ftext-mask-vat-id/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dimitrinicolas","download_url":"https://codeload.github.com/dimitrinicolas/text-mask-vat-id/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248456365,"owners_count":21106603,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["text-mask","tva","vat"],"created_at":"2025-02-20T07:39:49.932Z","updated_at":"2025-04-11T18:10:50.546Z","avatar_url":"https://github.com/dimitrinicolas.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# text-mask-vat-id [![Build Status][travis badge]][travis link] [![Coverage Status][coveralls badge]][coveralls link]\n\nText Mask function for VAT identification number.\n\n## [Example](https://dimitrinicolas.github.io/text-mask-vat-id/example/)\n\nDemo available here: [dimitrinicolas.github.io/text-mask-vat-id/example](https://dimitrinicolas.github.io/text-mask-vat-id/example/)\n\n## Installation\n\n```bash\nnpm i text-mask-vat-id\n```\n\n## Usage\n\nI recommend you to add an uppercase pipe function to text-mask component:\n\n```js\nfunction upperCasePipe(value) {\n  return value.toUpperCase();\n}\n```\n\n### With React.js\n\n```jsx\nimport React from 'react'\nimport MaskedInput from 'react-text-mask'\nimport createVatIdMask from 'text-mask-vat-id';\n\nconst mask = createVatIdMask();\n\nexport default () =\u003e (\n  \u003cMaskedInput\n    mask={mask}\n    pipe={value =\u003e value.toUpperCase()} /\u003e\n);\n```\n\n### In Vanilla JS\n\n```html\n\u003cscript src=\"./node_modules/vanilla-text-mask/dist/vanillaTextMask.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"./node_modules/text-mask-vat-id/dist/text-mask-vat-id.umd.min.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  function upperCasePipe(value) {\n    return value.toUpperCase();\n  }\n\n  vanillaTextMask.maskInput({\n    inputElement: document.getElementById('vat-input'),\n    mask: createVatIdMask(),\n    pipe: upperCasePipe\n  });\n});\n\u003c/script\u003e\n  ```\n\n## Options\n\nYou can pass options as an object when creating text mask:\n\n```js\nconst mask = createVatIdMask({\n  /** options */\n});\n```\n\n- `localeFormat` (default: `false`): If the mask should add separation\ncharacters (` `, `-`, `.` and `/`) to the VAT ID. E.g.: `\"FR19845015858\"` would\nbecome `\"FR 19 845 015 858\"`.\n\n## Build\n\nCompile with Rollup:\n\n```console\nnpm run build\n```\n\nBuild and test:\n\n```console\nnpm test\n```\n\n## Source\n\n- [en.wikipedia.org/wiki/VAT_identification_number](https://en.wikipedia.org/wiki/VAT_identification_number)\n- [www.gov.uk/guidance/vat-eu-country-codes-vat-numbers-and-vat-in-other-languages](https://www.gov.uk/guidance/vat-eu-country-codes-vat-numbers-and-vat-in-other-languages)\n\n## Related\n\n- [`text-mask`](https://github.com/text-mask/text-mask) - Input mask for React, Angular, Ember, Vue, \u0026 plain JavaScript\n\n## License\n\nThis project is licensed under the [MIT license](LICENSE).\n\n[travis badge]: https://travis-ci.org/dimitrinicolas/text-mask-vat-id.svg?branch=master\n[travis link]: https://travis-ci.org/dimitrinicolas/text-mask-vat-id\n[coveralls badge]: https://coveralls.io/repos/github/dimitrinicolas/text-mask-vat-id/badge.svg?branch=master\n[coveralls link]: https://coveralls.io/github/dimitrinicolas/text-mask-vat-id?branch=master\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimitrinicolas%2Ftext-mask-vat-id","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdimitrinicolas%2Ftext-mask-vat-id","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimitrinicolas%2Ftext-mask-vat-id/lists"}