0.1.0 • Published 4 years ago
node-strong v0.1.0
SHIMMER NODE STRONG
A Strong for node server-side object
INSTALL
npm install node-strong
HOW TO USE FOR js AND ts
it can use for save and read some config or data
data will save as a json file
simple use
const strong = require("node-strongjs")
//set
strong.set("welcome", "test-data")
//get
console.log(strong.get("welcome"))
// output "test-data"
custom
you can use the function strong.install() to set some custom config , and it must be run befor any other function
- object is a default object to init the strong
- path require a string of file path , it will make the file save use your path
- watch require a function , if it not null , it will watch the change for the file , and if happend will call your function but in this version , we don't recommend you use it for the object need often run set function
example
const strong = require("node-strongjs")
const path = require("path")
strong.install({"hello":"init"},path.join(__dirname,'./data.json'),null)
strong.get("hello")
0.1.0
4 years ago