{"id":22833187,"url":"https://github.com/brunobertolini/remask","last_synced_at":"2025-04-05T22:09:44.136Z","repository":{"id":34078130,"uuid":"169140242","full_name":"brunobertolini/remask","owner":"brunobertolini","description":"A lightweight, dependency free and framework agnostic multi-mask lib, with Typescript support.","archived":false,"fork":false,"pushed_at":"2023-10-07T14:09:50.000Z","size":676,"stargazers_count":154,"open_issues_count":4,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-29T22:33:28.838Z","etag":null,"topics":["input-mask","mask"],"latest_commit_sha":null,"homepage":"https://codesandbox.io/s/5k4960xmyn","language":"TypeScript","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/brunobertolini.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"brunobertolini"}},"created_at":"2019-02-04T20:00:28.000Z","updated_at":"2024-10-22T18:53:11.000Z","dependencies_parsed_at":"2024-06-18T16:40:45.361Z","dependency_job_id":"4a54722c-9a64-494d-adc6-f1fb6be5403c","html_url":"https://github.com/brunobertolini/remask","commit_stats":{"total_commits":16,"total_committers":2,"mean_commits":8.0,"dds":0.0625,"last_synced_commit":"2347b1c4bdd798554cf62ae1de60f92d1cb8f9d8"},"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunobertolini%2Fremask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunobertolini%2Fremask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunobertolini%2Fremask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunobertolini%2Fremask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brunobertolini","download_url":"https://codeload.github.com/brunobertolini/remask/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247406111,"owners_count":20933806,"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":["input-mask","mask"],"created_at":"2024-12-12T21:12:28.129Z","updated_at":"2025-04-05T22:09:44.110Z","avatar_url":"https://github.com/brunobertolini.png","language":"TypeScript","funding_links":["https://github.com/sponsors/brunobertolini"],"categories":[],"sub_categories":[],"readme":"[![.github/workflows/ci.yml](https://github.com/brunobertolini/remask/actions/workflows/ci.yml/badge.svg?branch=develop)](https://github.com/brunobertolini/remask/actions/workflows/ci.yml)\n\n\u003ch1 align=\"center\"\u003e\n  \u003cimg src=\"logo.png\" alt=\"Remask Logo\" /\u003e\n\u003c/h1\u003e\n\n\u003e A lightweight, dependency free and framework agnostic multi-mask lib, with Typescript support.\n\n## Install\n\n```\nyarn add remask\n```\n\n## Usage\n\n```js\nimport { mask } from 'remask'\n\nconst value = 'ABC1C83'\nconst pattern = 'AAA - 9S99'\n\nmask(value, pattern)\n// ABC - 1C83\n```\n\nPattern can be a pattern array, so remask choose one pattern based on pattern/value length match\n\n```js\nconst patterns = ['999.999.999-99', '99.999.999/9999-99']\n\nmask('12345678901', patterns) // gets firts pattern (999.999.999-99)\n// =\u003e 123.456.789-01\n\nmask('12345678000106', patterns) // gets second pattern (99.999.999/9999-99)\n// =\u003e 12.345.678/0001-06\n```\n\nand you can use `unmask` function to remove any mask pattern:\n\n```js\nunmask('12.345.678/0001-06')\n// =\u003e 12345678000106\n```\n\n### Currency\n\nIn currency mask, Remask use [Intl.NumberFormater](https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat) to mask and unmask values, so you need pass [locale](https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Intl#locale_negotiation) and currency params.\n\n```js\nimport { currency } from 'remask'\n\ncurrency.mask({ locale: 'pt-BR', currency: 'BRL', value: 123456.78 })\n// =\u003e R$ 123.456,78\n\ncurrency.unmask({ locale: 'pt-BR', currency: 'BRL', value: 'R$ 123.456,78' })\n// =\u003e 123456.78\n```\n\n## License\n\nMIT © [Bruno Bertolini](http://brunobertolini.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrunobertolini%2Fremask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrunobertolini%2Fremask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrunobertolini%2Fremask/lists"}