Socket
Socket
Sign inDemoInstall

closeness

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    closeness

test proximal range of number values


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Install size
1.63 kB
Created
Weekly downloads
 

Readme

Source

closeness

browser support

Test the proximal range of values

npm install closeness

example

The constructor takes 2 parameters, the target value, and the proximal range you want to test. It returns a function which takes a singe value as an argument, and return true or false if it is close enough.

var howClose = require('closeness');

var close = howClose(100, 5) // returns a fn that will test if your number is with 5 of 100

if(close(96)) console.log('yep its close enough')
if(!(close(50))) console.log('not close enough')

license

MIT I GUESS

FAQs

Last updated on 18 Mar 2013

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc