1.0.3 • Published 2 years ago

dummy-array v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Dummy Array

Node.js CI

Very simple package for creating a dummy array

Installation

With npm:

$ npm install dummy-array

With yarn:

$ yarn add dummy-array

Usage

import { createArray } from 'dummy-array';

// Basic usage, returns [0,1]
createArray({ to: 2 });

// With 'from' parameter, returns [2, 3]
createArray({ from: 2, to: 4 });

// With 'step' parameter, returns [0, 2, 4]
createArray({ step: 2, to: 5 });

// With `from ` and `step` parameter, returns [5, 7, 9]
createArray({ from: 5, step: 2, to: 10 });

Options

to

TypeDefault valueRequiredDescription
number-trueHow many elements shoud be in the array

from

TypeDefault valueRequiredDescription
number0falseFrom which element the function should start

step

TypeDefault valueRequiredDescription
number1falseBy how much should the function increase each element

Tests

$ npm install
$ npm run test

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago