Skip to content

Latest commit

 

History

History
33 lines (24 loc) · 711 Bytes

README.md

File metadata and controls

33 lines (24 loc) · 711 Bytes

localdown

A localStorage implementation of the LevelDOWN API

About

LocalDOWN is a drop-in replacement for LevelDOWN that uses node-localstorage to persist changes.

Example (ES6)

import localdown from 'localdown'

let db = localdown('/path/to/store/file')

db.open((error) => {
  db.put('1', 'one', (error) => {
    db.get('one', { asBuffer: false }, (error, value) => {
      console.log(value)
      // > one
      db.close((error) => {
        // ...
      })
    })
  })
})

Constructor

localdown(location[,quota])

  • location - file path
  • quota - storage quota, optional