Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
kevin-johnson
Advanced tools
PostgresSQL backed key/val store with support for JSON values and key expiration
Essentially hstore with JSON val and key expiration support
npm install kevin-johnson
const appStore = require('kevin-johnson');
const opts = {
appName: 'myApp',
dbUrl: process.env.DATABASE_URL
};
const key = 'key';
const val = 'val';
appStore(opts).then((ctx) => {
return store.set(key, val);
})
.then((obj) => {
const keys = Object.keys(obj);
console.log(keys[ 0 ]); // 'key'
console.log(obj[ key ]); // 'val'
});
Batch setting/getting
const items = {
foo: 'bar',
ping: {
beep: [ 'boop', 'bop' ]
}
};
store.setAll(items)
.then(() => {
return store.getAll(Object.keys(items));
})
.then(function(map) {
// map === items
});
Deletion
store.set('delMe', 'foo')
.then(() => {
return store.get('delMe');
}).then((obj) => {
console.log(obj); // { delMe: 'foo' }
return store.del('delMe');
}).then(() => {
return store.get('delMe');
}).then(function(item) {
console.log(item); // undefined
});
Key Expiration
store.set('beep', 'boop', 2000)
.then(() => {
setTimeout(() => {
store.get('beep')
.then((item) => {
console.log(item); // undefined
});
}, 4000);
});
Create your test PostgresSQL database and user and create a test.env file for environment constiables
$ createuser myApp
$ createdb myApp
$ echo "DATABASE_URL=postgres://myApp:Ffoodk@localhost:5432/myApp" >> test/test.env
$ echo "NODE_ENV=test" >> test/test.env
$ echo "APP_NAME=appName" >> test/test.env
$ npm test
FAQs
PostgresSQL backed key/val store with support for JSON values and key expiration
The npm package kevin-johnson receives a total of 3 weekly downloads. As such, kevin-johnson popularity was classified as not popular.
We found that kevin-johnson 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
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.