Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 28, 2024 via pnpm

arrify 3.0.0

Convert a value to an array
Package summary
Share
0
issues
1
license
1
MIT
Package created
16 Feb 2015
Version published
28 Apr 2021
Maintainers
1
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
arrify@3.0.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of arrify 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does arrify do?

Arrify is a popular npm package designed to convert a value into an array. If you have a value, whether it's a string, number, object, or even a set, arrify ensures it gets converted into an array. If the value is null or undefined, it results in an empty array, making sure the output is always an array. This functionality greatly enhances the convenience and speed of developing applications, particularly JavaScript-based applications where conversions between different data types are common.

How do you use arrify?

Using arrify is quite simple and straightforward thanks to its easy-to-use interface and integration capabilities with JavaScript. Start by installing it to your project using npm install arrify.

Here's a quick usage example:

import arrify from 'arrify';

arrify('πŸ¦„');
//=> ['πŸ¦„']

arrify(['πŸ¦„']);
//=> ['πŸ¦„']

arrify(new Set(['πŸ¦„']));
//=> ['πŸ¦„']

arrify(null);
//=> []

arrify(undefined);
//=> []

In the above examples you can see that when a string, an array, or a new set is input, it outputs a new array. When null or undefined are given as input, it returns an empty array. This ensures type consistency which can be crucial in many development scenarios.

Where are the arrify docs?

Arrify's documentation can be found directly on its GitHub page at https://github.com/sindresorhus/arrify and, of course, you can always search "arrify npm" or "arrify documentation" on your preferred search engine to locate the official docs. The readme in the GitHub repository provides installation and usage instructions, making it easy to understand the benefits of this useful package. By properly documenting its function and providing usage examples, the creators of arrify have made it easier to adopt and integrate into individual coding projects. For professional support, a Tidelift subscription is recommended.