Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/imedadel/listor

Turn any list of items into a sentence
https://github.com/imedadel/listor

i18n javascript list npm-package tsdx

Last synced: 5 days ago
JSON representation

Turn any list of items into a sentence

Awesome Lists containing this project

README

        

# listor

> Turn any list of items into a sentence.

## Installing

```sh
# npm
npm install listor

# yarn
yarn add listor
```

## Usage

```js
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`