{"id":28399285,"url":"https://github.com/andreypostal/jsgroupmask","last_synced_at":"2025-06-28T19:32:09.045Z","repository":{"id":224664189,"uuid":"297419668","full_name":"andreypostal/JSGroupMask","owner":"andreypostal","description":"Group of masks for input, with different number patterns.","archived":false,"fork":false,"pushed_at":"2020-09-22T01:11:40.000Z","size":11,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-01T15:24:05.118Z","etag":null,"topics":["html-element","javascript","js","mask"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andreypostal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2020-09-21T17:58:30.000Z","updated_at":"2021-11-17T14:15:41.000Z","dependencies_parsed_at":"2024-02-27T05:49:15.429Z","dependency_job_id":null,"html_url":"https://github.com/andreypostal/JSGroupMask","commit_stats":null,"previous_names":["andreypostal/jsgroupmask"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/andreypostal/JSGroupMask","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreypostal%2FJSGroupMask","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreypostal%2FJSGroupMask/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreypostal%2FJSGroupMask/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreypostal%2FJSGroupMask/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andreypostal","download_url":"https://codeload.github.com/andreypostal/JSGroupMask/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreypostal%2FJSGroupMask/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262484101,"owners_count":23318393,"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":["html-element","javascript","js","mask"],"created_at":"2025-06-01T07:39:48.834Z","updated_at":"2025-06-28T19:32:09.039Z","avatar_url":"https://github.com/andreypostal.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSGroupMask\n\nGroup of masks for input, with different number patterns.\n\nCrie máscaras dinâmicas para os seus inputs de texto, como CPF e CNPJ, telefones fixos e celulares, etc.\n\n## How to use\n\n- Import the file **mask.js**\u003cbr\u003e\n  Importe o arquivo **mask.js**\n\n- Create the input that will receive the mask\u003cbr\u003e\n  \u003csmall\u003eCrie o input que receberá a máscara\u003c/small\u003e\n\n```html\n\u003cinput type=\"text\" id=\"cpf-cnpj\" /\u003e\n\u003cinput type=\"text\" id=\"phone\" /\u003e\n```\n\n- Instantiate the mask to it, having as parameters the ID and an array with the masks\u003cbr\u003e\n  Instancie a máscara a ele, passando como parâmetro seu ID e um array contendo as máscaras.\n\n```javascript\nlet mask_cpf_cnpj = new Mask(\"cpf-cnpj\", [\n  \"__.___.___/____-__\",\n  \"___.___.___-__\",\n]);\n\nlet mask_phone = new Mask(\"phone\", [\n  \"+__ (__) ____-____\",\n  \"+__ (__) _____-____\",\n  \"+___ (__) _____-____\",\n]);\n```\n\nThe char **\\_** will be the space filled by numbers. Other characters (except for numbers) will be considered separators.\u003cbr\u003e\nOs caracteres **\\_** serão os espaços preenchidos por números. Demais caracteres (exceto números) serão considerados separadores.\n\n- Call the method **update** whenever you want to apply the mask to the current value of the input\u003cbr\u003e\n  Chame o método **update** sempre que quiser aplicar a máscara no valor atual do input.\n\n```javascript\nmask_cpf_cnpj.update();\nmask_phone.update();\n```\n\nAs in the example, applying the method to every key pressed, we can use the following code:\u003cbr\u003e\nComo no exemplo, aplicando o método para todo char inserido, podemos usar o trecho de código:\n\n```javascript\n$(\"#cpf-cnpj\").keyup(function () {\n  mask_cpf_cnpj.update();\n});\n\n$(\"#phone\").keyup(function () {\n  mask_phone.update();\n});\n```\n\n_Version developted really quickly, it is really simples, has some bugs, but does the job_\u003cbr\u003e\n_Versão desenvolvida rapidamente, é muito simples, tem alguns bugs, mas faz o que precisa_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreypostal%2Fjsgroupmask","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandreypostal%2Fjsgroupmask","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreypostal%2Fjsgroupmask/lists"}