@tni/cache
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

安装

# npm
npm install @tni/cache

# yarn
yarn add @tni/cache

# pnpm
pnpm add @tni/cache

使用

import { createLocalStorage, createSessionStorage, createStorage, WebStorage } from '@tni/cache'

const local = createLocalStorage()
const session = createSessionStorage()

local.set(key, value, expire)
local.get(key, defaultValue)
local.remove(key)
local.clear()

session.set(key, value, expire)
session.get(key, defaultValue? = null)
session.remove(key)
session.clear()

Package Sidebar

Install

npm i @tni/cache

Weekly Downloads

1

Version

1.0.6

License

MIT

Unpacked Size

50.1 kB

Total Files

10

Last publish

Collaborators

  • dt-terry