npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gmsoft-store

v1.0.2

Published

前端缓存策略

Downloads

2

Readme

gmsoft-store

前端缓存策略 设置、获取工具

gmsoft-store 前端缓存策略 设置、获取工具

NPM DOWNLOAD

Why

  • 封装了 localStoragesessionStorage 的设置和获取方法;
  • 约定了标识key,当本地存储到达上限无法继续注入时,依照策略清空缓存,便于新的缓存可以注入;
  • 设定全局时效,获取、设置时清空无效数据;

Todo

  • 针对react 封装 hooks
  • 尝试 indexed DB 的封装;

Install


  yarn add gmsoft-store

Api

| api | 描述 | 调用 | 返回 | 注意 | | -------------------- | --------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------ | ------------------------------------- | | createGroupKey | 构造分组key | createGroupKey(groupKey: string, itemKey: string) | string | - | | removeLocalStoreBy | 调用回调函数,清除对应的 Localstorage | removeLocalStoreBy(cb:(key:string)=>boolean) | void | 警告 操作的范围为任意key | | clearLocalStore | 清空 通过gmsoft-store创建的非冻结状态的Localstorage数据 | clearLocalStore()=>boolean) | void | - | | setLocalStore | 创建 Localstorage 数据 | setLocalStore(params:SetParams) | void | - | | getLocalStore | 获取 Localstorage 数据 | setLocalStore(key:string) setLocalStore(params:GetParams) | any | 冻结模式只能用GetParams模式调用 | | removeSessionStoreBy | 调用回调函数,清除对应的 Sessionstorage | removeSessionStoreBy(cb:(key:string)=>boolean) | void | 警告 操作的范围为任意key | | clearSessionStore | 清空 通过gmsoft-store创建的非冻结状态的Sessionstorage数据 | clearSessionStore()=>boolean) | void | - | | setSessionStore | 创建 Sessionstorage 数据 | setSessionStore(params:SetParams) | void | - | | getSessionStore | 获取 Sessionstorage 数据 | setSessionStore(key:string) setSessionStore(params:GetParams) | any | 冻结模式只能用GetParams模式调用 |

Update Log

  • 1.0.2

    2019-11-07

    • 🌟 添加 createGroupKey
  • 1.0.1

    2019-11-07

    • 🐞 修复 README.md 文档;
    • 🐞 修复 npm 关联 github 代码库地址;
  • 1.0.0

    2019-11-07

    • 🛠 重构项目结构;
    • 🌟 添加 Localstorage、Sessionstorage 基础方法;