Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

arrify

1.0.1 • Public • Published

arrify Build Status

Convert a value to an array

Install

$ npm install --save arrify

Usage

const arrify = require('arrify');
 
arrify('unicorn');
//=> ['unicorn']
 
arrify(['unicorn']);
//=> ['unicorn']
 
arrify(null);
//=> []
 
arrify(undefined);
//=> []

Supplying null or undefined results in an empty array.

License

MIT © Sindre Sorhus

install

npm i arrify

Downloadsweekly downloads

5,629,379

version

1.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability