Module: localStorage

Module supporting persistent local key-value storage. Has the same interface as the node-persist (https://github.com/simonlast/node-persist), except for values(callback) and fine-grained control functions (e.g. persist()).

Version:
  • $$Id$$
Author:
  • Hokeun Kim
Source:

Methods

(static) clear()

Remove all keys in the local storage.

Source:

(static) getItem()

Take a key and return its value from the local storage if the key exists, otherwise, return null.

Source:

(static) initSync()

Set up a new persistent storage in the file system. This must be called before calling any other functions in localStorage.

Source:

(static) key()

Return a key with index n, or null if it is not present.

Source:

(static) length()

Return the number of keys stored in the local storage.

Source:

(static) remove()

Take a key and remove it from the local storage.

Source:

(static) setItem()

Take a key-value pair and store the pair into the local storage.

Source: