humanize-react

1.0.0 • Public • Published

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-react
import 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

  • oxfordComma Boolean - Specify whether the Oxford comma should be included. Default: true
  • conjunction String - Specify a conjunction. Default: and

Running Locally

npm install
npm run lint
npm run compile

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    256
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    256
  • 0.1.2
    1
  • 0.1.1
    1
  • 0.1.0
    0

Package Sidebar

Install

npm i humanize-react

Weekly Downloads

140

Version

1.0.0

License

MIT

Unpacked Size

6.44 kB

Total Files

7

Last publish

Collaborators

  • chadly