Package Exports
- drahovdb
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (drahovdb) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
DB Module of powered by json files
Installation
npm install drahovdbFunctions
add(dataname,value)
get(dataname)
has(dataname)
remove(dataname)
copy(filename)
increase(dataname,value)
reduce(dataname,value)
clear()
Descriptions
add: Writes any value to dataname.
get: Gets value by dataname from filename.
has: Returnes true if the dataname has.
remove: Deletes any data from file.
copy: Copies the file to any file.
increase: If the value is number and the data is value you can increase the data.
reduce: If the value is number and the data is value you can reduce the data.
clear: Deletes all datas from file.
Examples
Constructor
const { Database } = require('drahovdb')
const db = new Database('file') //write file name without .json!Add
const { Database } = require('drahovdb')
const db = new Database('database')
db.add('nick','drahov') //adds database.json "nick":"drahov" dataGet
const { Database } = require('drahovdb')
const db = new Database('database')
db.get('nick') //returns drahovHas
const { Database } = require('drahovdb')
const db = new Database('database')
db.has('nick') //returns trueRemove
const { Database } = require('drahovdb')
const db = new Database('database')
db.remove('nick') //deletes nick dataCopy
const { Database } = require('drahovdb')
const db = new Database('database')
db.copy('database_copy') //copies database.json to database_copy.jsonIncrease
const { Database } = require('drahovdb')
const db = new Database('database')
db.add('int',10)
db.increase('int',1) //increases int value 1Reduce
const { Database } = require('drahovdb')
const db = new Database('database')
db.reduce('int',1) //reduces int value 1Copy
const { Database } = require('drahovdb')
const db = new Database('database')
db.clear() //deletes all datas from database.jsonNotice
Please write filenames without .json