1.0.1 • Published 8 months ago

@mbdo/array-builder v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

Array builder package

This ESM npm package exports utilities to build numeric arrays.

To start, it provides a function createArrayWithLength that allows you to create an array with a specified length n, with values from 1 to n.

Installation

Install the package using npm:

npm install @mbdo/array-builder

Usage

Import the package:

import { createArrayWithLength } from 'array-creation-util';

Call the function createArrayWithLength with the desired length as an argument to get an array containing numbers from 1 to the specified length:

const length = 5;
const newArray = createArrayWithLength(length);
console.log(newArray); // Output: [1, 2, 3, 4, 5]

API

createArrayWithLength(length)

Creates an array with a specified length.

  • length (number): The desired length of the array.

Returns:

  • (Array): An array containing numbers from 1 to the specified length.

License

This package is released under the MIT License. Please update the package name and other details as per your requirements.

1.0.1

8 months ago

1.0.0

8 months ago