Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dionne-davenport

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dionne-davenport

PostgresSQL backed key/val store with support for JSON values and key expiration

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Dionne Davenport

circle-status

js-standard-style

Essentially hstore with JSON val

$ npm install dionne-davenport --save

Basic setting/getting

const Dionne = require('dionne-davenport')
const opts = {
  appName: 'myApp',
  url: process.env.DATABASE_URL
}
const store = await Dionne(opts)
await store.set('as', 'if')
const result = await store.get('as')
console.log(result) // 'if'

Batch setting/getting

const items = {
  foo: 'bar',
  ping: {
    beep: [ 'boop', 'bop' ]
  }
}
await store.setAll(items)
const result = await store.getAll(Object.keys(items))
console.log(result)
/*
{
  foo: 'bar',
  ping: {
    beep: [ 'boop', 'bop' ]
  }
}
*/

Deletion

let item
await store.set('delMe', 'foo')
item = await store.get('delMe')
console.log('delMe') // foo

await store.del('delMe')
item = await store.get('delMe')
console.log(item) // undefined

Tests

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

Package last updated on 18 Apr 2017

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc