The `checksum` package by `dshaw` is a minimalistic utility for Node.js environments, designed to compute cryptographic hashes for strings and local files. It supports algorithms such as SHA1 (which is the default) and MD5, alongside others provided by Node.js's built-in `crypto` module. The package's current and only stable version, 1.0.0, was last published approximately five years ago (as of April 2026), indicating it is no longer under active maintenance or development. This makes it suitable primarily for legacy CommonJS Node.js projects. While it offers a straightforward API for both direct string hashing and asynchronous file hashing, as well as a command-line interface, developers should be aware of its unmaintained status and the use of older, less secure default hashing algorithms like SHA1 and MD5 for modern integrity verification needs. More contemporary Node.js projects often leverage the native `crypto` module directly or use newer, actively maintained third-party libraries that offer ESM support and stronger defaults.
npm install checksumVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to calculate checksums for both strings and files using the main `checksum` function and its `file` method, including cleanup.
Migrate to Node.js's built-in `crypto` module (e.g., `require('crypto').createHash('sha256')`) or a modern, actively maintained third-party library.Always specify a stronger algorithm like SHA256 or SHA512 using the `algorithm` option (e.g., `checksum(data, { algorithm: 'sha256' })`). For critical applications, consider `crypto.createHash('sha256')` directly.If your project is ESM, either use `createRequire` from the `module` module to import it, dynamically `import()` it (if compatible), or migrate to an ESM-compatible hashing library. Alternatively, ensure your project remains CommonJS.
Install `@types/checksum` if available, or create a custom `d.ts` declaration file (e.g., `declare module 'checksum';`). For better TS support, consider a library that ships with its own types.
If staying with ESM, use `import { createRequire } from 'module'; const require = createRequire(import.meta.url); const checksum = require('checksum');`. Otherwise, convert your project to CommonJS by setting `"type": "commonjs"` in `package.json` or renaming files to `.cjs`.First, try `npm cache clean --force`. If the problem persists, delete `node_modules/` and `package-lock.json`, then run `npm install` again. If the issue is persistent and related to SHA1, consider avoiding this outdated package.
No dependency data recorded yet.