
Research
/Security News
Miasma Mini Shai-Hulud Hits ImmobiliareLabs npm Packages
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.
@vyron/storage
Advanced tools
Powerful Browser Storage
With npm
# npm
npm install @vyron/storage
# yarn
yarn add @vyron/storage
# pnpm
pnpm install @vyron/storage
interface StorageCryptoConfig {
// storage encrypt Implementation
encrypt: (v: string) => string
// storage decrypt Implementation
decrypt: <T>(v: string) => T
}
interface StorageConfig {
// enable storage crypto
enableCrypto?: boolean
// crypto config
crypto?: StorageCryptoConfig
// storage key prefix
prefix?: string
}
| property | 解释 |
|---|---|
| get(key) | 获取 storage |
| set(key,value,expire?) | 设置 storage |
| remove | 移除 storage |
| clear | 清空 storage |
| key | 获取指定 key |
| keys | 获取所有 key |
| values | 获取所有值 |
| length | 获取 storage 长度 |
| isEmpty | storage 是否为空 |
return storage data
import { LocalStorage } from "@vyron/storage"
const storage = new LocalStorage()
storage.get("text") // null
storage.set("test", "text") // true
storage.get("test") // text
import { LocalStorage } from "@vyron/storage"
const storage = new LocalStorage()
// storage will expired after 10 seconds
storage.set("test", "text", 10) // true
storage.get("test") // text
setTimeout(() => {
// storage was expired & will be remove
storage.get("test") // null
}, 11 * 1000)
import { LocalStorage } from "@vyron/storage"
const storage = new LocalStorage()
storage.set("test", "text") // true
storage.set("test2", "text2") // true
storage.set("test3", "text3") // true
storage.remove("test")
storage.remove(["test2", "test3"])
console.log(storage.isEmpty) // true
import { LocalStorage } from "@vyron/storage"
const storage = new LocalStorage()
storage.set("test", "text") // true
storage.set("test2", "text2") // true
storage.set("test3", "text3") // true
// storage will remove all but test3
storage.clear("test3")
console.log(storage.length) // 1
storage.get("test3") // text3
import { LocalStorage } from "@vyron/storage"
const storage = new LocalStorage()
storage.set("test", "text") // true
storage.set("test2", "text2") // true
storage.set("test3", "text3") // true
storage.key(0) // test
storage.key(1) // test2
storage.key(2) // test3
storage.key(100) // null
import { LocalStorage } from "@vyron/storage"
const storage = new LocalStorage()
storage.set("test", "text") // true
storage.set("test2", "text2") // true
storage.set("test3", "text3") // true
storage.keys() // ['test','test2','test3']
import { LocalStorage } from "@vyron/storage"
const storage = new LocalStorage()
storage.set("test", "text") // true
storage.set("test2", "text2") // true
storage.set("test3", "text3") // true
storage.values() // ['text','text2','text3']
import { LocalStorage } from "@vyron/storage"
const storage = new LocalStorage()
storage.set("test", "text") // true
storage.set("test2", "text2") // true
storage.length // 2
import { LocalStorage } from "@vyron/storage"
const storage = new LocalStorage()
storage.isEmpty // true
storage.set("test", "text") // true
storage.isEmpty // false
FAQs
多引擎持久化存储管理包,支持 LocalStorage、SessionStorage 和 Cookie 驱动,并提供前/后缀空间安全、过期时长管理和嵌套 path 解析。
The npm package @vyron/storage receives a total of 3 weekly downloads. As such, @vyron/storage popularity was classified as not popular.
We found that @vyron/storage demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.

Security News
Rolldown paused Rust React Compiler integration after a 5MB binary size increase raised concerns about shipping React-specific code to all Vite users.

Security News
/Research
Mini Shai-Hulud expands into the Go ecosystem after hitting LeoPlatform npm packages and targeting GitHub Actions workflows.