Socket
Book a DemoInstallSign in
Socket

incr

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

incr

increment a counter with optional radix

1.0.1
latest
npmnpm
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

node-incr

Build Status

NPM

testling badge

a counter that will return decimal integers starting at 1 by default. optionally start the counter at another number and/or use a different radix

install

npm install incr

test

npm test

usage

var Increment = require("incr")

var inc = new Increment()
console.log(inc.next()) // 1
console.log(inc.next()) // 2
console.log(inc.next()) // 3
inc.reset()
console.log(inc.next()) // 1

var inc = new Increment({start: 10})
console.log(inc.next()) // 11
console.log(inc.next()) // 12
console.log(inc.next()) // 13

var inc = new Increment({radix: 36})
console.log(inc.next()) // "1"
console.log(inc.next()) // "2"
console.log(inc.next()) // "3"

var inc = new Increment({start: 20, radix: 36})
console.log(inc.next()) // "l"
console.log(inc.next()) // "m"
console.log(inc.next()) // "n"

Keywords

autoincrement

FAQs

Package last updated on 30 Jan 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.