Skip to content
/ yes.js Public

JavaScript clone of *nix's yes command. For the record, this library is kind of poking fun at the `yes` command (though is completely functional!).

License

Notifications You must be signed in to change notification settings

bostrt/yes.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yes.js NPM version

Yes.js is basically a wrapper around the setInterval and clearInterval JavaScript functions. Yes.js makes it a little easier to manage repeating interval calls.

Install

bower install yes.js or npm install yes.js

Node.js users...var Yes = require('yes.js');

API

http://bostrt.github.io/yes.js/

Examples

var myYes = new Yes();
var yesID = myYes.yes(function(str) {
    console.log(str);
}, "Oh yes!", 1000);

// ...

yes.kill(yesID);
function getUserLocation() {
...
}

var myYes = new Yes();

// Same old string
myYes.yes(function(str) {
    console.log(str);
}, "Oh Yes!", 1000);

// You can even pass functions!
myYes.yes(function(func) {
    console.log("User is at " + func());
}, getUserLocation, 5000);

// ...
// Let's kill both of our intervals.
myYes.kill();

About

JavaScript clone of *nix's yes command. For the record, this library is kind of poking fun at the `yes` command (though is completely functional!).

Resources

License

Stars

Watchers

Forks

Packages

No packages published