0.1.0 • Published 7 years ago

chrome-db v0.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

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
  });