@fastify/leveldb
Version:
Plugin to share a common LevelDB connection across Fastify.
20 lines (16 loc) • 522 B
text/typescript
import fastify from 'fastify'
import { LevelUp } from 'levelup'
import { expectAssignable, expectDeprecated, expectType } from 'tsd'
import fastifyLeveldb, { FastifyLeveldbOptions, LevelDBOptions } from '..'
const app = fastify()
app
.register(fastifyLeveldb, {
name: 'test',
path: '.local',
options: { valueEncoding: 'json' }
})
.after(async (_err) => {
expectType<LevelUp>(app.level.test)
})
expectDeprecated({} as LevelDBOptions)
expectAssignable<FastifyLeveldbOptions>({} as LevelDBOptions)