Giter Club home page Giter Club logo

npm-download-inflator's Introduction

npm-install-count-inflator

Artificially increase the download-counter of any npm package!

Read more about this here.

Install

$ npm install --save install-count-inflator

Usage

Requiring install-count-inflator will return a class. Upon instantiation it will increment the download count of the specified package every second.

var InstallInflator = require('install-count-inflator');

var inflator = new InstallInflator({
    name: 'install-count-inflator',
});

Options

name

Type: string

The name of the npm package.

onPing

Type: function

A function to be called whenever the download count gets increased.

Default: function() {}

var InstallInflator = require('install-count-inflator');

var inflator = new InstallInflator({
    name: 'install-count-inflator',
    onPing: function(timesPinged) {
		console.log('The download count has been incremented ' + timesPinged + ' times!');
	}
});

delay

Type number

The amount of time to wait between pings in milliseconds

Default: 1000

version

Type string

The version of the package.

Default: '1.0.0'

scope

Type string

The scope of the npm package if it is scoped

Default: null

var InstallInflator = require('@caltrop/install-count-inflator');

var inflator = new InstallInflator({
    name: 'install-count-inflator',
    version: '1.0.0',
    scope: 'caltrop'
});

Methods

stop

Stops the interval, optionally takes an amount of time in milliseconds to wait before stopping.

The example below increases the download count of this package once every 250 milliseconds and automatically stops after 10 seconds:

var InstallInflator = require('install-count-inflator');

var inflator = new InstallInflator({
    name: 'install-count-inflator',
    delay: 250
});

inflator.stop(10 * 1000);

License

This demo is licensed under the GNU General Public License v3.0. You may copy, distribute and modify the software as long as you track changes/dates in source files. Any modifications to this project must be made available under the GPL along with build & install instructions.

npm-download-inflator's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.