Features

all storage methods are asynchronous. You can get the response from this method by using * .then * or await if it is within the scope of an asynchronous function.

Setter and Getter

get(prop)

null

string

Recover data from storage.

const all = await storages.websites.get()
const urls = await storages.websites.get('urls')

set(props)

object

Defines one or more properties of a storage.

storages.website.set({
    urls: ['github.com']
})

Synchronizers

sync(props)

object

Receive functions that will be performed when a prop is modified.

storages.websites.sync({
    urls(err, data){ ... }
})

syncAll(callback)

function

Receives functions that will be executed when any prop is modified.

storages.websites.syncAll((err, data) => {...})

syncMany(propsNamesArray, functions)

array

function

Receives functions that will be executed when the defined props are modified.

storages.websites.syncMany(['urls', 'names'], (err, data) => {...})

Utils

clear()

Clears the entire table.

storages.websites.clear()

restoreDefaultValues()

Restores the data to the default values registered in the schema.

storages.websites.restoreDefaultValues()

restoreDefaultValues()

Restores the data to the default values registered in the schema.

storages.websites.restoreDefaultValues()

still()

Silences the emission of modification events for the context in which it was applied. This is a chained method, returning to the instantiated and muted object.

storages.websites.still().set({urls: ['http://google.com']})

Next: Storages props