Skip to content

Inflector that is compatible with ActiveSupport::Inflector

License

Notifications You must be signed in to change notification settings

atsjj/inflector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Inflector

build doc npm

Inflector is a library that is compatible with ActiveSupport::Inflector. Inflector has first-class support for Deno and TypeScript, but also ships with support for Node CommonJS and ES Modules.

Inflector is based on the work of Ember Inflector and Ember.js.

Install (Node)

npm install --save @atsjj/inflector;

Usage

Deno

import { pluralize, singularize } from "https://deno.land/x/inflector/mod.ts";

console.log(pluralize("cat")) // "cats"
console.log(singularize("searches")) // "search"

Browser

<script type="module">
  import { pluralize, singularize } from "https://cdn.skypack.dev/@atsjj/inflector";

  console.log(pluralize("cat")) // "cats"
  console.log(singularize("searches")) // "search"
</script>

Node / ESM

import { pluralize, singularize } from "@atsjj/inflector";

console.log(pluralize("cat")) // "cats"
console.log(singularize("searches")) // "search"

Node / CJS

const { pluralize, singularize } = require("@atsjj/inflector");

console.log(pluralize("cat")) // "cats"
console.log(singularize("searches")) // "search"

About

Inflector that is compatible with ActiveSupport::Inflector

Resources

License

Stars

Watchers

Forks

Packages

No packages published