{"id":15015724,"url":"https://github.com/emberjs/ember-inflector","last_synced_at":"2025-04-10T06:18:06.203Z","repository":{"id":4195808,"uuid":"5314780","full_name":"emberjs/ember-inflector","owner":"emberjs","description":"ember-inflector goal is to be rails compatible.","archived":false,"fork":false,"pushed_at":"2024-10-24T08:58:42.000Z","size":1969,"stargazers_count":106,"open_issues_count":30,"forks_count":80,"subscribers_count":18,"default_branch":"master","last_synced_at":"2024-10-29T15:44:46.428Z","etag":null,"topics":[],"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/emberjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","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":"emberjs","open_collective":"emberjs"}},"created_at":"2012-08-06T13:59:39.000Z","updated_at":"2024-10-24T08:58:04.000Z","dependencies_parsed_at":"2024-11-06T16:41:06.489Z","dependency_job_id":"b008536b-9e5f-45c8-9d46-e2da24b88e77","html_url":"https://github.com/emberjs/ember-inflector","commit_stats":{"total_commits":255,"total_committers":53,"mean_commits":4.811320754716981,"dds":0.8313725490196078,"last_synced_commit":"3c0a7aa9671aeaf23b6357e866510df346d9a60d"},"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emberjs%2Fember-inflector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emberjs%2Fember-inflector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emberjs%2Fember-inflector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emberjs%2Fember-inflector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emberjs","download_url":"https://codeload.github.com/emberjs/ember-inflector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243690112,"owners_count":20331726,"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":[],"created_at":"2024-09-24T19:47:50.617Z","updated_at":"2025-03-20T01:45:32.650Z","avatar_url":"https://github.com/emberjs.png","language":"JavaScript","funding_links":["https://github.com/sponsors/emberjs","https://opencollective.com/emberjs"],"categories":[],"sub_categories":[],"readme":"# Ember Inflector [![CI](https://github.com/emberjs/ember-inflector/workflows/CI/badge.svg)](https://github.com/emberjs/ember-inflector/actions/)\n\nEmber Inflector is a library for inflecting words between plural and singular forms. Ember Inflector aims to be compatible with [ActiveSupport::Inflector](http://api.rubyonrails.org/classes/ActiveSupport/Inflector.html) from Ruby on Rails, including the ability to add your own inflections in your app.\n\n\n## Compatibility\n\n- Ember.js v3.16 or above\n- Embroider or ember-auto-import v2\n\n## Installation\n\n```\nember install ember-inflector\n```\n\n## Usage\n\nAll methods are always available from the `ember-inflector` module:\n\n```javascript\nimport Inflector from 'ember-inflector';\nimport { singularize, pluralize } from 'ember-inflector';\n\nInflector.inflector.singularize(\"tacos\"); // taco\nInflector.inflector.pluralize(\"taco\"); // tacos\n\nsingularize(\"tacos\"); // taco\npluralize(\"taco\"); // tacos\n\npluralize(2, \"taco\"); // 2 tacos\npluralize(2, \"tacos\", { withoutCount: true }); // tacos\n```\n\n### Custom Rules\n\nIf necessary you can setup special inflection rules for your application:\n\n```javascript\nimport Inflector from 'ember-inflector';\n\nInflector.inflector.irregular('person', 'people');\nInflector.inflector.uncountable('sheep');\n\n```\n\n### Template Helpers\n\n#### pluralize\n\nPluralize a word\n```hbs\n{{pluralize \"taco\"}} -\u003e tacos\n```\n\nSpecify a count with the word, with the pluralization being based on the number of items.\n```hbs\n{{pluralize 1 \"taco\"}} -\u003e 1 taco\n{{pluralize 2 \"taco\"}} -\u003e 2 tacos\n```\n\nSpecify a count with the word, with the pluralization being based on the number of items. Specify `without-count=true` to return on the word without the number.\n```hbs\n{{pluralize 1 \"taco\" without-count=true}} -\u003e taco\n{{pluralize 2 \"taco\" without-count=true}} -\u003e tacos\n```\n\n#### singularize\n```hbs\n{{singularize 'octopi'}} -\u003e octopus\n```\n\n\n## Contributing\n\nSee the [Contributing](CONTRIBUTING.md) guide for details.\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femberjs%2Fember-inflector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femberjs%2Fember-inflector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femberjs%2Fember-inflector/lists"}