@iota/persistence-adapter-level
v1.0.0-beta.30
Published
Level persistence adapter, with support for different store types.
Downloads
115
Readme
@iota/persistence-adapater-level
Persistence adapter with support for different abstract-level
stores, such as
leveldown
(recommended default), leveljs
, memdown
and others...
Example with @iota/persistence
import { persistence, persistenceID } from '@iota/persistence'
import { persistenceAdapter } from '@iota/persistence-adapter-level'
import leveldown from 'leveldown'
;(async function (seed) {
const persistenceAdapter = createPersistenceAdapter({
persistenceID: persistenceID(seed),
persistencePath: './test/temp', // test directory
store: leveldown, // default store
})
try {
const { nextIndex } = createPersistence(persistenceAdapter)
return await nextIndex()
} catch (error) {
return error
}
})('SOME9SEED')