How martinandert/inflected works
Project type and purpose
• This is an open-source utility library (a port of Rails/ActiveSupport’s Inflector) for Node.js and the browser.
• It provides a suite of string-inflection functions (pluralize, singularize, camelize, underscore, etc.) and customization points (Inflector.inflections).
File structure
• Top level: configuration files (.eslintrc, .babelrc, rollup.config.js, .travis.yml, Makefile), package.json, README.
• src/ directory: individual modules—Inflector.js, Transliterator.js, applyInflections.js and one file per inflection function (pluralize.js, singularize.js, camelize.js, etc.).
• src/util: helper functions (isFunction.js).
• test/ directory: test/cases.js and test/index.js driving the test suite.
README for additional insights
• Confirms the API exported by index.js, build targets (CommonJS, ES module, UMD), zero‐dependency claim, and how to add custom inflection rules.
• Explains usage in Node.js and UMD in the browser.