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

nj-hammer

v1.1.0

Published

Nickj's javascript-bussiness-function-code collection.

Downloads

9

Readme

NJ-Hammer

Build Status LICENSE MIT

Nickj's JavaScript 业务工具代码集合 NPM 包,该项目主要目的在于分类整合工作日常中常用的工具代码,并打包成一个可以长期维护的 NPM 包,集中与提升日常工作效率与减少网上搜索的过程,也了解了 NPM 包的基本发布过程。

发布自己的 NPM 包

官方与网上已有很多流程,我也借此机会记录我的 NPM 发布过程。

NPM 官方账号注册

访问 npm 官方网站,并注册一个自己的账号,已有账号跳过这一步。

Package.json 配置

命令行 npm init 新建项目,并准确填写各项项目基本信息,并确保项目名字没有与已发布的 npm 包的名字重复,直接在 npm 官方网站搜索一下,看是否有结果就知道了。

发布

完成当前初始版本之后, 切记发布前养成测试当前版本功能代码再发布的习惯, 命令行 npm publish 即可, 之后每次发布前只需更改 package.json中的 version 的版本号即可更新 npm 包。

使用

发布完成后并无任何报错,即可在你的项目中 npm install <projName> --save-dev 安装你发布的 npm 包了。之后就可以正常使用你的包了。

const njHammer = require('nj-hammer');

Catalog

Present contain

  • Array
  • Class
  • Cookie
  • Device
  • Dom
  • Function
  • Keycode
  • Object
  • Random
  • Regexp
  • String
  • Support
  • Time
  • Url

Use

NPM:

npm install nj-hammer --save-dev
// import whole proj
const hammer = require('nj-hammer')
const arrayEqual = hammer.arrayEqual()

// import partly proj
const arrayEqual = require('nj-hammer/script/arrayEqual')

Or by ES6

// import whole proj
import { arrayEqual } from 'nj-hammer'

// import partly proj
import  arrayEqual  from 'nj-hammer/script/arrayEqual'

Build

npm run build

Pubilsh

// login first
npm pubilsh (first pubilsh -> npm pubilsh --tag <tagname>)