Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fill-range

Package Overview
Dependencies
Maintainers
4
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fill-range

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`

  • 3.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
66M
decreased by-11.9%
Maintainers
4
Weekly downloads
 
Created

What is fill-range?

The fill-range npm package is used to generate an array of numbers or strings based on a given range with support for steps, negative ranges, and pattern expansion. It is often used for creating lists of numbers, expanding number and letter sequences, and generating arrays based on patterns.

What are fill-range's main functionalities?

Number Range Generation

Generates an array of numbers from 1 to 5.

[...fillRange(1, 5)]

Letter Range Generation

Generates an array of letters from 'a' to 'e'.

[...fillRange('a', 'e')]

Pattern Expansion

Expands a pattern '1..3' and applies a transformation function to each value, resulting in ['item1', 'item2', 'item3'].

[...fillRange('1..3', { transform: (val) => `item${val}` })]

Step Support

Generates an array of numbers from 1 to 10 with a step of 2, resulting in [1, 3, 5, 7, 9].

[...fillRange(1, 10, { step: 2 })]

Negative Range Support

Generates an array of numbers from -3 to 3.

[...fillRange(-3, 3)]

Other packages similar to fill-range

Keywords

FAQs

Package last updated on 15 Sep 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc