JavaScript inflection
by gmosx, at 11 Jun 2010As the lead (and lone) developer of an early Rails competitor, I am not particularly fond on DHH & Co. However, there is no denying that good ideas did emerge in the Rails ecosystem. One such idea is the use of inflection to replace configuration with convention.
Some time ago, I needed a simple code generator for one of my projects, thus I looked around for a JavaScript inflection library. After experimenting with a couple of ports of old ActiveSupport code, I decided to implement a subset of the latest ActiveSupport version and package it for CommonJS.
Download the JavaScript inflection library, and try some examples:
var pluralize = require("inflection").pluralize
pluralize("entry"); // "entries"
var singularize = require("inflection").singularize
singularize("words"); // "word"


