Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bostrt/yes.js
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!).
https://github.com/bostrt/yes.js
Last synced: 3 months ago
JSON representation
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!).
- Host: GitHub
- URL: https://github.com/bostrt/yes.js
- Owner: bostrt
- License: mit
- Created: 2013-11-14T01:08:53.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2013-11-16T02:59:59.000Z (about 11 years ago)
- Last Synced: 2024-10-10T13:18:17.437Z (3 months ago)
- Language: JavaScript
- Homepage: http://bostrt.github.io/yes.js/
- Size: 180 KB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
yes.js [![NPM version](https://badge.fury.io/js/yes.js.png)](http://badge.fury.io/js/yes.js)
====================================================================================================
_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
-------
```javascript
var myYes = new Yes();
var yesID = myYes.yes(function(str) {
console.log(str);
}, "Oh yes!", 1000);// ...
yes.kill(yesID);
``````javascript
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();
```