gmosx

JavaScript inflection

by gmosx, at 11 Jun 2010

As 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"

4 Comments

by deca durabolin, at 18 Nov 2011
What are you stating, man? I realize everyones got their own view, but really? Listen, your web site is neat. I like the energy you put into it, especially with the vids and the pics. But, come on. Theres gotta be a better way to say this, a way that doesnt make it seem like everyone here is stupid!
by fattevexrap, at 03 Feb 2012
Stalthitpam Anrielelin Annelafuess http://napechke.com - Senanamaso nuthHulfuct http://napechke.com
by fattevexrap, at 11 Feb 2012
Stalthitpam Anrielelin Annelafuess http://napechke.com - Senanamaso nuthHulfuct http://napechke.com