Skip to content

Lukavyi/start-from-zero

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

start-from-zero

Convert between human and machine numbering. Basically, it provides an interface to add or subtract 1 from provided number.

Installation

npm install --save start-from-zero

Example usage

import num from 'start-from-zero';

// when you want to convert under-the-hood number to human-readable one(add 1 to it)
num.toHuman(0); // 1

// when you want to convert human-readable number to zero-based one(subtract 1 from it)
num.toMachine(1); // 0

Example with destructuring

import { toHuman, toMachine } from 'start-from-zero';

// when you want to convert an under-the-hood number to a human-readable one(add 1 to it)
toHuman(0); // 1

// when you want to convert a human-readable number to a zero-based one(subtract 1 from it)
toMachine(1); // 0

About

Convert between human and machine numbering

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published