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.
npm install --save @atsjj/inflector;
import { pluralize, singularize } from "https://deno.land/x/inflector/mod.ts";
console.log(pluralize("cat")) // "cats"
console.log(singularize("searches")) // "search"
<script type="module">
import { pluralize, singularize } from "https://cdn.skypack.dev/@atsjj/inflector";
console.log(pluralize("cat")) // "cats"
console.log(singularize("searches")) // "search"
</script>
import { pluralize, singularize } from "@atsjj/inflector";
console.log(pluralize("cat")) // "cats"
console.log(singularize("searches")) // "search"
const { pluralize, singularize } = require("@atsjj/inflector");
console.log(pluralize("cat")) // "cats"
console.log(singularize("searches")) // "search"