Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stevemao/array-ify
Turn anything into an array
https://github.com/stevemao/array-ify
Last synced: 2 months ago
JSON representation
Turn anything into an array
- Host: GitHub
- URL: https://github.com/stevemao/array-ify
- Owner: stevemao
- License: mit
- Created: 2015-06-14T23:21:56.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-03-20T05:54:48.000Z (almost 7 years ago)
- Last Synced: 2024-10-19T20:03:41.842Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage Status][coveralls-image]][coveralls-url]
> Turn anything into an array
## Install
```sh
$ npm install --save array-ify
```## Usage
```js
var arrayify = require('array-ify');arrayify('unicorn');
//=> ['unicorn']arrayify(['unicorn']);
//=> ['unicorn']arrayify(null);
//=> [null]arrayify(undefined);
//=> [undefined]
```## Related
- [arrify](https://github.com/sindresorhus/arrify) - Convert a value to an array
The difference that is this module does **NOT** turn `null` or `undefined` to an empty array.
## License
MIT © [Steve Mao](https://github.com/stevemao)
[npm-image]: https://badge.fury.io/js/array-ify.svg
[npm-url]: https://npmjs.org/package/array-ify
[travis-image]: https://travis-ci.org/stevemao/array-ify.svg?branch=master
[travis-url]: https://travis-ci.org/stevemao/array-ify
[daviddm-image]: https://david-dm.org/stevemao/array-ify.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/stevemao/array-ify
[coveralls-image]: https://coveralls.io/repos/stevemao/array-ify/badge.svg
[coveralls-url]: https://coveralls.io/r/stevemao/array-ify