humanize-react
v1.0.0
Published
Comma delimit an array of React components for human readability.
Downloads
997
Maintainers
Readme
Humanize React
Comma delimit an array of React components for human readability with an Oxford comma, because we are not barbarians.
Usage
npm install humanize-reactimport humanize from "humanize-list";
humanize([<>Homer <strong>Simpson</strong></>, <><strong>Marge</strong> Simpson</>]) // => Homer Simpson and Marge Simpson (with formatting)
humanize(["apples", "tomatoes", "unicorns"]) // => "apples, tomatoes, and unicorns"
humanize(["apples", "tomatoes", "unicorns"], { conjunction: "or" }) // => "apples, tomatoes or unicorns"
humanize(["apples", "tomatoes", "unicorns"], { oxfordComma: false }) // => "apples, tomatoes and unicorns"Options
oxfordCommaBoolean - Specify whether the Oxford comma should be included. Default:trueconjunctionString - Specify a conjunction. Default:and
Running Locally
npm install
npm run lint
npm run compile