Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including npm-counter-example with all npm packages installed. Try it out:

var npmCounterExample = require("npm-counter-example")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

npm-counter-example v1.0.4

This is simple stepcounter

Increment & Decrement Counter

This is a Simple Javascript stepcounter


Add incrementorAndDecrementor.js to your html file


<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8">

    <script src="../node_modules/npm-counter-example/incrementorAndDecrementor.js"></script>
<div id="countByOne"></div>

Step 1: add some class to the div.

<div id="countByOne"></div>

Step 2: Initialize the plugin on your page. For example

// initialize with defaults

Using NPM

To install using the npm package manager run:

$ npm install npm-counter-example


Contributions are always welcome!

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free