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

npm-storage

v0.0.3

Published

短小精悍的前端缓存插件,解决前端内存泄漏问题

Downloads

7

Readme

npm-storage

短小精悍的前端缓存插件,解决前端内存泄漏问题

项目地址

https://github.com/catbea/npm-storage

官网地址

https://catbea.github.io/npm-storage.github.io

简介

  • 这是一个H5的缓存插件,在项目中经常会使用localStorage或sessionStorage来缓存数据,
  • 为了使代码更精炼整洁,有经验有能力的开发同学都会对缓存的方法做封装。
  • 作者已帮你造好了这个轮子,拿来即用!!!
  • 非常开心,您发现了“我”,请放心使用吧!!!

安装

使用npm:npm install npm-storage

使用git

  • 一,ssh方式:git clone [email protected]:catbea/npm-storage.git
  • 二,https方式:git clone https://github.com/catbea/npm-storage.git

使用方式

首先在html文件中引入js(根据你项目的路径) <script src="../dist/main.js"></script>

  • (提示:众所周知,H5的缓存有两个,一是永久缓存localStorage,二是会话级缓存sessionStorage)
  • 在本插件中
  • MyLStorage 代表localStorage
  • MySStorage 代表sessionStorage

增加缓存(MyLStorage和MySStorage使用方法一致)

MyLStorage.set(key,value);

获取缓存

MyLStorage.get(key);

删除某一个缓存

MyLStorage.remove(key);

清除所有缓存

MyLStorage.clear();

源码下载

https://github.com/catbea/npm-storage/releases

快速使用

简单接入的文档

交流和提问

https://github.com/catbea/npm-storage/issues

关于作者

  • 作者本人从事前端数年,热爱前端事业,热衷于为广大前端开发同学做一点小贡献。
  • 在这条路上有你有我,一同向前~~~

ending

  • 如果用的顺手,请给个小star!!!

  • 满意的话,可以支持一下!!!

  • 加微信好友 image

  • 微信扫码支持 image

  • 支付宝扫码支持 image