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

Note

Add incrementorAndDecrementor.js to your html file

Example

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>StepCounter</title>

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

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
  $('#countByOne').stepCounter();

Using NPM

To install using the npm package manager run:

$ npm install npm-counter-example

Contribute

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