Skip to content

npm versioncode style: prettier

Task Repeater

A promise based tool which will repeat your tasks a defined amount of times

Prerequisites

This project requires NodeJS (version 8 or later) and NPM. Node and NPM are really easy to install. To make sure you have them available on your machine, try running the following command.

sh
$ npm -v && node -v
6.4.1
v8.16.0
$ npm -v && node -v
6.4.1
v8.16.0

Table of contents

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Installation

BEFORE YOU INSTALL: please read the prerequisites

Start with cloning this repo on your local machine:

sh
$ git clone https://github.com/arijitdn/task-repeater.git
$ cd task-repeater
$ git clone https://github.com/arijitdn/task-repeater.git
$ cd task-repeater

To install and set up the library, run:

sh
$ npm install @arijitdn/task-repeater
$ npm install @arijitdn/task-repeater

Or if you prefer using Yarn:

sh
$ yarn add @arijitdn/task-repeater
$ yarn add @arijitdn/task-repeater

Usage

Example 1:

js
const { repeatTask } = require("@arijitdn/task-repeater");

const n = 10;
function task() {
  console.log("Hello World\n");
}

repeatTask(task, n);
const { repeatTask } = require("@arijitdn/task-repeater");

const n = 10;
function task() {
  console.log("Hello World\n");
}

repeatTask(task, n);

Example 2:

js
const { repeatTask } = require("@arijitdn/task-repeater");

repeatTask(() => {
  console.log("Hello World\n");
}, 10);
const { repeatTask } = require("@arijitdn/task-repeater");

repeatTask(() => {
  console.log("Hello World\n");
}, 10);

Built With

  • NodeJS

Authors

License

Apache 2.0 © Arijit Debnath