1.0.1 • Published 6 years ago

kofiloop v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

KofiLoop

Fast and powered loops under caffeine.

npm.io

Build Status FOSSA Status

Getting Started

Installation

Install via NPM:

$ npm install kofiloop

How to use

Add this at the top of your module's file:

var kofiloop = require('kofiloop');

or this if you're using TypeScript or another ES6 preprocessor:

import * as kofiloop from 'kofiloop';

After that, you will be able to create your first loop:

// We starts the loop every 1000ms (= 1 second).
kofiloop.startLoop(function(){
    console.log("Looped " + this.step + " times");
}, 1000)

// When the loop looped 100 times, we stop it.
.on('step-100', function(loop) {
    loop.stop();
})

// When the loop ends, we log.
.end(function(){
	console.log("The loop is stopped.");    
});

Documentation

The documentation is available at kofiloop.js.org.

Built With

  • TypeScript - A typed superset of JavaScript.
  • TypeDoc - A documentation generator for TypeScript projects.

License

This project is licensed under the MIT License - see the LICENSE.md file for details