https://github.com/renzp94/idxdb
一款零依赖、简单易用的indexedDB库
https://github.com/renzp94/idxdb
indexeddb indexeddb-api indexeddb-helper
Last synced: 12 months ago
JSON representation
一款零依赖、简单易用的indexedDB库
- Host: GitHub
- URL: https://github.com/renzp94/idxdb
- Owner: renzp94
- Created: 2024-01-08T01:58:23.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-21T07:55:30.000Z (almost 2 years ago)
- Last Synced: 2025-06-08T16:02:48.061Z (12 months ago)
- Topics: indexeddb, indexeddb-api, indexeddb-helper
- Language: TypeScript
- Homepage: https://idxdb.deno.dev
- Size: 1.24 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# @renzp/idxdb
一款零依赖、快速灵活、简单易用的indexedDB API库
## 安装
```sh
npm install @renzp/idxdb
```
## 使用
```ts
import { IdxDB } from '@renzp/idxdb'
const DB_NAME = "test"
await IdxDB.useDB({
name: DB_NAME,
version: 1,
stores: [
{
name: 't_user',
indexes: ['name', 'age'],
keyPath: 'id',
},
],
})
const db = new IdxDB(DB_NAME)
await db.connect()
await db?.store('t_user')?.getQuery({ values: {name: 'renzp94'} })
db.close()
```
更多使用方法可以查看[文档](https://idxdb.deno.dev)
