Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
cnwhy committed Oct 10, 2023
1 parent 138a9af commit 62046f2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# IDB-OPEN-PLUSH
# IDB-OPEN-PLUS

[![Coverage Status](https://coveralls.io/repos/github/cnwhy/idb-open-plush/badge.svg?branch=master)](https://coveralls.io/github/cnwhy/idb-open-plush?branch=master) [![github test](https://github.com/cnwhy/idb-open-plush/workflows/test/badge.svg?branch=master)](https://github.com/cnwhy/idb-open-plush/actions/workflows/test.yml)
[![Coverage Status](https://coveralls.io/repos/github/cnwhy/idb-open-plus/badge.svg?branch=master)](https://coveralls.io/github/cnwhy/idb-open-plus?branch=master) [![github test](https://github.com/cnwhy/idb-open-plus/workflows/test/badge.svg?branch=master)](https://github.com/cnwhy/idb-open-plus/actions/workflows/test.yml)

**idb-open-plush** 是提供给需要使用 `indexedDB` 却被 `indexedDB version` 机制困扰的人; 使用它之后完全不需要再去处理 `version`, 至始至终都按你的需要 创建/打开/更新 对应的`IDBDatabase`;
**idb-open-plus** 是提供给需要使用 `indexedDB` 却被 `indexedDB version` 机制困扰的人; 使用它之后完全不需要再去处理 `version`, 至始至终都按你的需要 创建/打开/更新 对应的`IDBDatabase`;

## 使用方法及代码示例

### 简单 KV 库实现

```js
import { idbOpen } from "idb-open-plush";
import { idbOpen } from "idb-open-plus";

class IdbKV {
constructor(dbName, store) {
Expand Down Expand Up @@ -58,7 +58,7 @@ console.log(await kv1.get("key2"));
### 搭配`idb`库使用 代码变得更丝滑

```js
import { idbOpen } from "idb-open-plush";
import { idbOpen } from "idb-open-plus";
import { openDB, wrap, unwrap } from "idb";

class IdbKV {
Expand Down Expand Up @@ -114,7 +114,7 @@ type InitOptions = {
### 约定式创建/更新 `ObjectStore`

```typescript
import { idbOpen } from "idb-open-plush";
import { idbOpen } from "idb-open-plus";

function getDB() {
// return idbOpen("db1", { store: "st1|++,name" }); // 只有一个ObjectStore时可以这样简写
Expand Down Expand Up @@ -171,7 +171,7 @@ function getDB() {
### 自定义创建/更新 `ObjectStore`

```typescript
import { idbOpen } from "idb-open-plush";
import { idbOpen } from "idb-open-plus";

const getDB = async () => {
return idbOpen("db1", {
Expand Down
2 changes: 1 addition & 1 deletion demo/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { openDB, wrap, unwrap } from "idb";
import idbOpen from "../";
import { idbDelete } from "../";

// const { idbOpen, idbDelete } = window.idbOpenPlush;
// const { idbOpen, idbDelete } = window.idbOpenPlus;

// window.idbOpen = idbOpen;

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "idb-open-plush",
"version": "1.0.2",
"name": "idb-open-plus",
"version": "1.0.0",
"description": "Open indexedDb to get the Database you need",
"main": "dist/idb-open-plush.cjs.js",
"browser": "dist/idb-open-plush.umd.js",
"main": "dist/idb-open-plus.cjs.js",
"browser": "dist/idb-open-plus.umd.js",
"module": "lib/index.js",
"types": "lib/index.d.ts",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion test/bdd.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { assert } from "chai";
import { idbOpen, idbDelete } from "../src";
// const { idbOpen, idbDelete } = (window as any).idbOpenPlush;
// const { idbOpen, idbDelete } = (window as any).idbOpenPlus;
// (window as any).idbOpen = idbOpen;
// (window as any).idbDelete = idbDelete;
const log = function (...arg) {};
Expand Down

0 comments on commit 62046f2

Please sign in to comment.