Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
simple-json-cache
Advanced tools
auto save json data to disk/localStorage when object change. it support nodejs and web.
auto save json data to disk/localStorage when object change. it support nodejs and web.
# install dependencies
npm install simple-json-cache --save
# node test
cd node_modules/simple-json-cache
npm run test
const SimpleJsonCache = require('simple-json-cache')
const DiskCache = require('simple-json-cache/cache-engine/disk-cache.js')
var sjc = new SimpleJsonCache(new DiskCache({
dir: 'cache',
debug: true
}), {
saveDelay: 1000,
debug: true
})
//auto load data from cache/data.json
var data = sjc.newObject({a:'a',b:[1,2,3],c:{c1:10}},'data')
data.b.push(data.c.c1) //auto save data to cache/data.json
data.c.c1++ //auto save to data cache/data.json
//but
data.newProto='newProto' //this will do nothing when you add a new proto in object
data.save() //you must invoke save method to save json data
const SimpleJsonCache = require('simple-json-cache')
const StorageCache = require('simple-json-cache/cache-engine/storage-cache.js')
Vue.prototype.sjc = new SimpleJsonCache(new StorageCache({
prefix: 'jsc_',
debug: true
}), {
saveDelay: 1000,
debug: true
})
//in vue file
var config = this.sjc.newObject({a:'aaa',b:[1,2,3]},'config') //auto load data from localStorage['jsc_config']
config.a='sdsasa' //auto save data to localStorage['jsc_config']
config.b[1]++ //auto save data to localStorage['jsc_config']
//but
config.newProto='newProto' //this will do nothing when you add a new proto in object
config.save() //you must invoke save method to save json data
FAQs
auto save json data to disk/localStorage when object change. it support nodejs and web.
The npm package simple-json-cache receives a total of 7 weekly downloads. As such, simple-json-cache popularity was classified as not popular.
We found that simple-json-cache demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.