Skip to content
Turn any list of items into a sentence
TypeScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
test
.gitignore
README.md
package.json
tsconfig.json
yarn.lock

README.md

listor

Turn any list of items into a sentence.

Installing

# npm
npm install listor

# yarn
yarn add listor

Usage

const listor = require('listor')

listor([1, 1, 'java'])
//=> '1, 1, and java'

API

listor(words: any[], oxford?: boolean, comma?: string, separator?: string): string

words

Type: any[]

Example: [1, 1, 'java']

oxford

Type: boolean

Default: true

comma

Type: string

Default: ,

separator

Type: string

Default: and

You can’t perform that action at this time.