improbable

0.0.1 • Public • Published

probably

probably run a function

install

npm install improbable

usage

var probably = require('improbable').probably
 
var maybeHello = probably(0.5, function() { console.log('hello') })
// 0.5 probability of being this function, 0.5 of being noop
 
maybeHello()
maybeHello()
maybeHello()
// calling over will always yield same result, either logging "hello" or doing nothing
 

license

MIT

Readme

Keywords

Package Sidebar

Install

npm i improbable

Weekly Downloads

2

Version

0.0.1

License

MIT

Last publish

Collaborators

  • mweitzel