chrome-db

0.1.0 • Public • Published

Chrome DB

A script to interface with the chrome extension database using Promises.

.get

Callback

const db = new ChromeDB();
db.get(['object', 'path'], result => {
  // Process results
});

Promise

const db = new ChromeDB();
db
  .get(['object', 'path'])
  .then(result => {
    // Process results
  });

Setting it using an object path

const db = new ChromeDB();
db
  .get('object.path')
  .then(result => {
    // Process results
  });

.set

Callback

const db = new ChromeDB();
db.set({ object : { path : 'test' } }, result => {
  // Do stuff
});

Promise

const db = new ChromeDB();
db
  .set(['object', 'path'], 'test')
  .then(result => {
    // Process results
  });

Setting it using an object path

const db = new ChromeDB();
db
  .set('object.path', 'test')
  .then(result => {
    // Process results
  });

Readme

Keywords

none

Package Sidebar

Install

npm i chrome-db

Weekly Downloads

1

Version

0.1.0

License

MIT

Last publish

Collaborators

  • seanjm