Skip to main content

CurateClick

CurateClick favicon

stokado

Weekly Pick

stokado是一个JavaScript库,可以代理任何类storage对象,提供简洁的语法糖操作、类型序列化、监听订阅、设置过期和一次性取值等功能,兼容localStorage、sessionStorage等存储方案。

Check out stokado on CurateClick

• Copy the embed code to showcase this product on your website

• Share on X to spread the word about this amazing tool

项目地址: https://github.com/KID-joker/stokado文章地址: https://juejin.cn/post/7357546247848869926项目介绍: stokado 可以代理任何类 storage 的对象,实现简洁的 getter,setter 等语法糖,序列化,监听订阅,设置过期,一次性取值等功能。#### 1. Syntax sugar通过对象方式直接操作 storage````jsconst storage = createProxyStorage(localStorage)storage.test = 'hello stokado'storage.test // 'hello stokado'delete storage.test```同时也支持 storage 的原生方法和属性:key(),getItem(),setItem(),removeItem(),clear()和length。#### 2. Serializer保持值类型不变```js// numberstorage.test = 0storage.test === 0// booleanstorage.test = falsestorage.test === false// undefinedstorage.test = undefinedstorage.test === undefined// nullstorage.test = nullstorage.test === null// objectstorage.test = { hello: 'world' }storage.test.hello === 'stokado'// arraystorage.test = ['hello']storage.test.push('stokado')storage.test.length // 2// Datestorage.test = new Date('2000-01-01T00:00:00.000Z')storage.test.getTime() === 946684800000// RegExpstorage.test = /d(b+)d/gstorage.test.test('cdbbdbsbz')// functionstorage.test = function () { return 'hello stokado!'}storage.test() === 'hello stokado!'```#### 3. Subscribe监听储值的变化```jsstorage.on(key, callback)storage.once(key, callback)storage.off([[key], callback])```#### 4. Expired为指定项设置过期时间```jsstorage.setExpires(key, expires)storage.getExpires(key)storage.removeExpires(key)```#### 5. Disposable一次性取值,可用于借助 storage` 进行通信jsstorage.setDisposable(key)

Latest Weekly Picks

CurateClick favicon
Pick

payprm.com

PAYPRM 为中文用户提供 ChatGPT Plus/Pro、Claude、Gemini、Grok 等 AI 会员开通与续费相关商品,支持支付宝付款。用户可在商品页查看价格、库存和开通要求,下单后可通过订单页面查询处理进度;具体交付方式及售后规则以对应商品详情为准。

CurateClick favicon

flyingroadsterai.com

Flying Roadster AI Video Generator turns car photos into shareable cinematic flight clips, with an optional portrait, six aspect ratios, and one-time credit packs.

CurateClick favicon

projectmoonlife.com

Project Moon Life is a free browser life simulator with randomized beginnings, meaningful choices, an atmospheric City, and an archive of every run.

Independent audiophile gear reviews with a transparent scoring system, plus 16 free in-browser audio tools.

CurateClick favicon

getfacereport.com

Private face analysis with personalized style guidance and hairstyle previews.

CurateClick favicon

lovableapp.org

Discover beautiful apps built with vibe coding

CurateClick favicon

antiquescanner.org

Identify antiques, vintage items and collectibles from photos, with estimated market value.

CurateClick favicon

imagelayered.com

AI-powered image decomposition tool that transforms flat images into editable layers.