项目作者: ImedAdel

项目描述 :
Turn any list of items into a sentence
高级语言: TypeScript
项目地址: git://github.com/ImedAdel/listor.git
创建时间: 2019-07-29T16:03:05Z
项目社区:https://github.com/ImedAdel/listor

开源协议:

下载


listor

Turn any list of items into a sentence.

Installing

  1. # npm
  2. npm install listor
  3. # yarn
  4. yarn add listor

Usage

  1. const listor = require('listor')
  2. listor([1, 1, 'java'])
  3. //=> '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