Unstorage 提供了一个异步的键值存储 API,具备常规功能,如多驱动挂载、监听和元数据处理,以及数十种内置驱动。
[![npm 版本][npm-version-src]][npm-version-href] [![npm 下载量][npm-downloads-src]][npm-downloads-href] [![Codecov][codecov-src]][codecov-href] [![bundle][bundle-src]][bundle-href] [![许可证][license-src]][license-href] Unstorage 提供了一个异步键值存储 API,具备多驱动挂载、监听、元数据操作等常规功能,内置数十种驱动,并拥有一个微型核心。
安装 unstorage npm 包:
# yarn
yarn add unstorage
# npm
npm install unstorage
# pnpm
pnpm add unstorageimport { createStorage } from "unstorage";
const storage = createStorage(/* opts */);
await storage.getItem("foo:bar"); // or storage.getItem('/foo/bar')查看文档以获取使用信息。
您可以通过夜间发布频道,使用 unstorage-nightly 来尝试 main 分支中的最新更改。
如果直接在项目中使用 unstorage:
{
"devDependencies": {
"unstorage": "npm:unstorage-nightly"
}
}如果通过项目中的其他工具使用 unstorage:
{
"resolutions": {
"unstorage": "npm:unstorage-nightly"
}
}pnpm install 安装依赖pnpm dev 启动 jest 监视器以验证更改pnpm test 确保所有测试和 lint 检查通过Documentation MIT [npm-version-src]: https://im
暂无开放 Issues,或尚未同步最近议题。