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 1, 2024 via pnpm

fill-range 7.0.1

Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`
Package summary
Share
0
issues
1
license
3
MIT
Package created
25 Nov 2014
Version published
8 Apr 2019
Maintainers
4
Total deps
3
Direct deps
1
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
3 Packages, Including:
fill-range@7.0.1
is-number@7.0.0
to-regex-range@5.0.1
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

1
All Dependencies CSV
β“˜ This is a list of fill-range 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
to-regex-range5.0.17.3 kBMIT
prod

Visualizations

Frequently Asked Questions

What does fill-range do?

The "fill-range" package in JavaScript is a user-friendly tool that is designed to generate an array of alphabetic or numeric sequences. It provides an option to set an increment or 'step' for creating the range and also the capability to create a regex-compatible range by utilizing the options.toRegex setting.

How do you use fill-range?

Utilizing the "fill-range" package is fairly straightforward and can be done in a few steps. First, it needs to be installed in your project with npm using the command $ npm install --save fill-range.

Once installed, the fill-range function can be required at the top of your file like so: const fill = require('fill-range');.

The general usage of the fill-range function is fill(from, to[, step, options]);β€” where 'from' is the starting point of your range, 'to' is the endpoint, 'step' is the optional increment or decrement level for the range, and 'options' is an object to apply different configuration settings.

Some example usages are:

console.log(fill('1', '10')); // Returns ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']
console.log(fill('a', 'e')); // Returns ['a', 'b', 'c', 'd', 'e']
console.log(fill(1, 5));  // Returns [1, 2, 3, 4, 5]
console.log(fill('0', '25', 5)); // Returns ['0', '5', '10', '15', '20', '25'] because it skips by 5 in the range from 0 to 25
console.log(fill('a', 'z', { toRegex: true })); // Returns 'a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z' as a regex-compatible string

The fill-range function is very flexible and allows for a lot of custom functionality using the 'options' argument, such as enabling the options.toRegex setting to return a regex-compatible source string instead.

Where are the fill-range docs?

The documentation for "fill-range" can be found in the readme content on the fill-range GitHub repository. The readme outlines the basic usage of fill-range, provides example usage code, and discusses the different configuration options available to you. The readme content is the main source of documentation for the "fill-range" package.