npm

Need private packages and team management tools?Check out npm Orgs. »

next-number

1.0.0 • Public • Published

next-number Build Status

Get consecutively numbers calculated with a chosen function.

Install

$ npm install --save next-number

Usage

const nextNumber = require('next-number');
const next = nextNumber(50, a => a + 1);
 
console.log(next(), next(), next(), next());
//=> 51 52 53 54

API

nextNumber(input, function)

Returns a function that when called will return the next number calculated with the provided function.

input

Required
Type: number

Number to start from.

function

Required
Type: function

Function to calculate the next number with.

License

MIT © Andreas Gillström

install

npm i next-number

Downloadsweekly downloads

4

version

1.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability