1.1.4 • Published 5 years ago

level-mount v1.1.4

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

level-mount

Mount multiple leveldown compatible stores by key prefix onto a single store.

LevelMount, like file system directory mounts and somewhat like the opposite of subleveldown. Can be used with subleveldown. Examples:

const hybrid_db = levelup(levelmount({
  db: leveldown('root'),
  options: {}, // options for leveldown open
  mounts: [
    {
      mount: '!tmp!',
      db: memdown(),
    },
    {
      mount: '!var!',
      db: someotherdown(),
      options: {}, // someotherdown options for leveldown open
    }
  ],
})

hybrid_db.put('hello', 'world') // ends up in root leveldown with key `hello`
hybrid_db.put('!tmp!blah', 'bleh') // ends up in memdown with key `blah`

const var_db = subleveldown(hybrid_db, 'var', { separator: '!' })
var_db.put('goodbye', 'world') // ends up in someotherdown with key `goodbye`

levelmount is a abstract leveldown complaint store meaning all other operations are also supported (batch, iterators, etc..) and work the way you'd expect. Iteration across multiple leveldbs seemlessly enables you to segregate key prefixes by store enabling things like storing indexes in different databases from the data itself!

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago