🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

arrford

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arrford

Array to human readable list converter

1.0.2
Source
npm
Version published
Weekly downloads
38
-5%
Maintainers
1
Weekly downloads
 
Created
Source

arrford

npm version Build Status NPM downloads

Array to human readable list converter


Install

npm install --save arrford

Usage

const arrford = require('arrford');

arrford(['run', 'climb', 'jump!']);
//=> 'run, climb, and jump!'

Fewer than 3 elements in array

arrford(['run', 'climb!']);
//=> 'run and climb!'

arrford(['run!']);
//=> 'run!'

Abort the Oxford comma

arrford(['run', 'climb', 'jump!'], false);
//=> 'run, climb and jump!'

API

arrford(target [, oxford])

target

Type: Array of strings

oxford

optional
Type: boolean
Default: true
Description: whether to use the Oxford comma or not

Take an array of strings and return a string of these items as an english list. Insert "," and "and" in a grammatically correct way. Follow the Oxford comma trend unless false is passed in for the second argument. Returns: string


License

MIT © Dawson Botsford

Keywords

grammar

FAQs

Package last updated on 03 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts