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

@litehex/node-checksum

v0.2.1

Published

A simple node.js module to calculate checksum with different algorithms

Downloads

47

Readme

node-checksum

npm install size GPL-3.0 Licensed

Checksum utility Library written for Node.js + CLI

📦 Installation

npm i -g @litehex/node-checksum # or npx @litehex/node-checksum help

📚 Documentation

For all configuration options, please see the API docs

📖 CLI Usage

Usage: checksum [options] [command]

Options:
  -h, --help                            display help for command

Commands:
  verify|v [options] <file> [checksum]  verify checksum
  hash|h [options] [file...]            hash a file or directory
  help [command]                        display help for command
Examples
Hashing
$ checksum hash package.json --algorithm sha256
>d033084eeb1b83e54db79013c9676ff2c51b3ee24c5542787daaa8b526ff2004

$ checksum h package.json README.md -a md5
>85f96e23f8adb7e1b1faf6f6341fe768 package.json
>ddc66b29b08d70b9accaa797d98ccdcc README.md

$ checksum hash --exclude "**/{.git,node_modules}/**" .
>62bbd7fec4e27c35cbf9a5058913c1e76ebe5d9dcb7ae6644f79c4cec1c6821b .gitignore
>88f36901e0a2735c58156120e9887ed0456918c8ffbf3a60eca0a9f221faa6ab .mocharc.json
>5f0fd6fa76c54ca557bdecdb6de94cec59745b4cd90469d79210c1554b679a18 .prettierignore
>...

$ checksum h --recursive src >checksum.txt

$ checksum h -C "Hello World" --algorithm md5
>b10a8db164e0754105b7a99be72e3fe5

$ echo -n "Hello World" | checksum h -a sha1
>0a4d55a8d778e5022fab701977c5d840bbc486d0
Verify
$ checksum verify package.json d033084eeb1b83e54db79013c9676ff2c51b3ee24c5542787daaa8b526ff2004 # exit code 0
>package.json: OK

$ echo -n "56bfa638dc6449196cf8110d693b6dab" | checksum v package.json -a md5 # exit code 0
>package.json: OK

$ checksum v -c checksum.txt # exit code 1
>tsup.config.ts: OK
>test/index.test.ts: FAILED
>...
>WARNING: 2 computed checksums did NOT match

$ echo -n "WRONG" | checksum v package.json -a md5 # exit code 1
>package.json: FAILED

$ echo -n "WRONG" | checksum v package.json -a md5 --quiet # exit code 1

🤝 Contributing

You can contribute to this project by opening an issue or a pull request on GitHub. Feel free to contribute, we care about your ideas and suggestions.

License

GPL-3.0 © Shahrad Elahi