Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/imedadel/listor
- Owner: imedadel
- Created: 2019-07-29T16:03:05.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-08-13T11:31:07.000Z (over 5 years ago)
- Last Synced: 2024-12-22T10:34:27.027Z (12 days ago)
- Topics: i18n, javascript, list, npm-package, tsdx
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/listor
- Size: 104 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
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`