
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
ember-inflector
Advanced tools
Ember Inflector is a library for inflecting words between plural and singular forms. Ember Inflector aims to be compatible with ActiveSupport::Inflector from Ruby on Rails, including the ability to add your own inflections in your app.
Ember CLI/NPM:
npm install --save ember-inflector
All methods are always available from Ember.Inflector
, but in Ember CLI, you can always import
instead:
import Inflector from 'ember-inflector';
import {singularize, pluralize} from 'ember-inflector';
Inflector.inflector.singularize("tacos"); // taco
Inflector.inflector.pluralize("taco"); // tacos
singularize("tacos"); // taco
pluralize("taco"); // tacos
// or if not using Ember CLI/ES6
Ember.Inflector.inflector.pluralize("taco"); // tacos
###Template Helpers ####pluralize
Pluralize a word
{{pluralize "taco"}} //tacos
Specify a count with the word, with the pluralization being based on the number of items.
{{pluralize 1 "taco"}} //1 taco
{{pluralize 2 "taco"}} //2 tacos
Specify 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.
{{pluralize 1 "taco" without-count=true}} //taco
{{pluralize 2 "taco" without-count=true}} //tacos
####singularize
{{singularize 'octopi'}} //octopus
FAQs
The default blueprint for Embroider v2 addons.
The npm package ember-inflector receives a total of 92,731 weekly downloads. As such, ember-inflector popularity was classified as popular.
We found that ember-inflector demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.