is-within

1.0.0 • Public • Published

is-within

Simple tool for testing if a given input is within a threshold of a target.

example

var isWithin = require('is-within');
 
var input = 5;
var target = 6;
var threshold = 2;
var thresholdZero = 0;
 
isWithin(input, target, threshold); // -> true
isWithin(input, target, thresholdZero); // -> false

isWithin(input, target, threshold)

  • input - the number you want to test
  • target - the target number
  • threshold - how much tolerance +/- from the target to allow

installation

npm install is-within

test

npm test

licence

MIT

Dependencies (0)

    Dev Dependencies (1)

    Package Sidebar

    Install

    npm i is-within

    Weekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • alexander-daniel