This module convert a text to unique id. Unique ID is autoincrement number. It return always the same number for the same text. Only for Nodejs
Installation
- $ npm i -g npm
- $ npm init
- $ npm i --save texttoid
DEMO 1
const textToID =
For Example:
let x = console
1
let x = console
2
If you want to use difference databases
DEMO 2
const textToID =
For Example:
let x = console
1
let x = console
1
let x = console
2
If you dont want to a new ID, and then make second parameter false
let x = console>>> false cant found id>>>
It gives back always the same ID for the same textes
If you want to a new start for IDs (or remove database)
For Example 1:
let x = console
documents removed. Now documents ID will start 1.
For Example 2:
let x = console
projects removed. Now projects ID will start 1.
For Example 3: (Remove default database)
let x = console
db removed. Now db ID will start 1.