{"id":25721428,"url":"https://github.com/alchemyalcove/formformatters","last_synced_at":"2025-05-06T22:21:55.648Z","repository":{"id":57240274,"uuid":"98031627","full_name":"AlchemyAlcove/FormFormatters","owner":"AlchemyAlcove","description":"Formatters and masks for validating and manipulating user input.","archived":false,"fork":false,"pushed_at":"2024-08-28T15:28:32.000Z","size":225,"stargazers_count":0,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-19T06:57:34.710Z","etag":null,"topics":["formatters","javascript","mask"],"latest_commit_sha":null,"homepage":null,"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/AlchemyAlcove.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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}},"created_at":"2017-07-22T13:01:20.000Z","updated_at":"2020-04-30T21:27:06.000Z","dependencies_parsed_at":"2025-02-25T18:49:13.473Z","dependency_job_id":"645b1b78-7bf6-440b-9a21-3c743be8400a","html_url":"https://github.com/AlchemyAlcove/FormFormatters","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlchemyAlcove%2FFormFormatters","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlchemyAlcove%2FFormFormatters/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlchemyAlcove%2FFormFormatters/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlchemyAlcove%2FFormFormatters/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlchemyAlcove","download_url":"https://codeload.github.com/AlchemyAlcove/FormFormatters/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252777359,"owners_count":21802590,"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":["formatters","javascript","mask"],"created_at":"2025-02-25T18:49:04.076Z","updated_at":"2025-05-06T22:21:55.612Z","avatar_url":"https://github.com/AlchemyAlcove.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Form Formatters\n\n[![CircleCI](https://circleci.com/gh/AlchemyAlcove/FormFormatters/tree/master.svg?style=svg\u0026circle-token=8d93970e17263a753de9a3f15a8cd855b345b91b)](https://circleci.com/gh/AlchemyAlcove/FormFormatters/tree/master)\n\nFormatters and masks for validating and manipulating user input.\n\nFormatters take user input in an object and return an object representing user data, parsed data, and errors. For example if the user entered \" 1112223333 \" into a currency field. The response would be:\n\n```json\n{\n  errors: [],\n  formatted: \"$1,112,223,333.00\",\n  parsed: 1112223333,\n  valid: true\n}\n```\n\nEntering \"abc\" into a currency field would result in:\n\n```json\n{\n  error: [\"FormFormatters.required\"],\n  formatted: \"abc\",\n  parsed: \"abc\",\n  valid: false\n}\n```\n\nYou might be thinking, but it's a number field how come the result has letters in it? Well the formatters job is to format the text and respond with whether it is valid. The masks job is to mask out values like letters from currency inputs. The mask should run before the formatter.\n\nData going into the formatters is structured the same going in as coming out that way they are chainable.\n\nConverters take a parsed value (from the api) and convert them into a form usable value.\n\nThe mask will return in the the same format as the entry. In other words, it will not return in a complex object.\n\n## Error Messaging\n\nThis library is designed for use with a translation tool. It will respond with unique keys representing error text. You could use [Simple Translator](https://github.com/AlchemyAlcove/SimpleTranslator) library for multi lingual support on error messages.\n\n## Formatters\n\n- ArrayFormatter\n- CurrencyFormatter\n- DateFormatter\n- EmailFormatter\n- HexFormatter\n- NameFormatter\n- NumberFormatter\n- PercentFormatter\n- PhoneFormatter\n- RgbFormatter\n- SsnLastFourFormatter\n- StringFormatter\n- TimeFormatter\n\n## Masks\n\n- ArrayMask\n- CurrencyMask\n- DecimalMask\n- EmailMask\n- HexMask\n- NumberMask\n- PercentMask\n- PhoneMask\n- SsnMask\n- SsnLastFourMask\n- StringMask\n- TimeMask\n- WholeNumberMask\n\n## Converters\n\n- DateConverter\n\n## Releases\n\nv1.0.3\n\nFixing formatters to work with same in same out object approach.\n\nAdded date converter.\n\nv1.0.2\n\nAdded Array formatter and Array Mask\n\nv1.0.1\n\nAdded Number mask\n\n\nv0.4.1\n\nHex formatter now includes a # symbol at the beginning of the string.\n\n\nv0.4.0\n\n- Add credit card formatter\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falchemyalcove%2Fformformatters","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falchemyalcove%2Fformformatters","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falchemyalcove%2Fformformatters/lists"}