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 🙏

© 2025 – Pkg Stats / Ryan Hefner

salt-lib

v0.2.1

Published

Salt-lovely's lite lib

Downloads

84

Readme

salt-lib

盐的自用库,写了一些通用方法,文档见Github

没有任何依赖,非常干净.jpg;整个打包后仅有7KiB,Gzip后仅3KiB。

使用

yarn add salt-lib
import { deepClonePlus } from 'salt-lib'

const loopSet = { set: new Set() }
loopSet.set.add(loopSet) // 使用Set引用自身

const loopSetClone = deepClonePlus(loopSet)
loopSetClone.set.has(loopSetClone) // true

因为入口文件使用了export { ... } from '...'的写法,因此可以放心地导入任意方法而不用担心摇树优化(tree-shake)之类的问题。

更多方法详见文档

主要功能

常见utils

  • 异步方法,如sleepdefer
  • 控制台方法,打印内容的同时隐藏行号。
  • DOM操作,如isOutside$$
  • 杂项方法,如assert
  • 对象操作方法,如isUnsafePropNameextend
  • 随机数方法,如randomChoiceuuidV4
  • 资源加载方法,如addTempScriptsetStyle
  • 类型守卫,如isArrayLikeObjectisUndefined
  • localStorage封装,如writereadAndListen

polyfill与特殊方法

  • 使用polyfill.io的polyfill功能:polyfillIOpolyfillES5polyfillES8

打包发布

tsc
npm publish