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

js-common-toolkit

v1.0.3

Published

Make the modal component of bootstrap easier to use

Downloads

10

Readme

js常用方法工具

检测目标是否是空,是否是对象,是否是数组,获取地址栏指定参数值,检测是否是手机号,复制内容到剪切板,获取图片真实宽高等等

调用方式

安装

npm i js-common-toolkit

引入

import jsUtils from 'js-common-toolkit'

示例:

// 检测目标是否为空
jsUtils.isEmpty('')

// 检测内容是否为邮箱
jsUtils.isEmail('[email protected]')

// 获取url链接上userName的值
jsUtils.getUrlParam('userName')

创建js工具项目

npm init -y 快速生成一个node.js项目,-y 参数表示自动接受默认设置,无需手动输入 修改package.json配置项: name属性是插件的名称,不允许重复; 添加 type:"module",就可以在js里面使用import和export; version不允许重复,每次发布都得改一下

js工具发布到npm

需要设置npm源
npm config set registry https://registry.npmjs.org/

登录npm账号(输入账号、密码、邮箱)
npm login

发布到npm上,可以npm i 安装使用
npm publish

** version版本不允许重复