Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

next-number

gillstrom11MIT1.0.0

Get consecutively numbers calculated with a chosen function.

calc, calculate, consecutive, consecutively, function, generate, get, integer, next, number

readme

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