Files
js-sha256/package.json
T
Yi-Cyuan Chen a6d0f636aa ### Added
- Add dedicated ESM, CommonJS, Node.js, and browser distribution entry points.
- Add streaming support to the native Node.js SHA-256, SHA-224, and HMAC implementations.
- Add distribution contract tests and real browser Web Worker tests with Playwright.
- Add Node.js 16, 18, 20, 22, and 24 runtime tests against the packed npm artifact.

### Changed
- Refactor the implementation into environment-independent core and Node.js modules.
- Use the native Node.js `crypto` implementation for hashing and HMAC.
- Load the package version automatically when generating distribution banners.
- Export unminified ESM source directly and build only CommonJS and browser/minified distributions.
- Replace `expect.js`, NYC, Tiny Worker, and UglifyJS with Node.js assert, c8, Playwright, and Rollup/Terser.
- Build automatically before `npm pack` and `npm publish`.
- Throw error if update after finalize

### Removed
- Remove runtime CommonJS, AMD, Node.js, Web Worker, and ArrayBuffer environment switches from the core implementation.
- Remove legacy environment flags and obsolete compatibility polyfills.
- Remove the old generated `sha256.mjs` and `sha256.node.mjs` entry points.
2026-07-27 14:30:34 +08:00

66 lines
2.0 KiB
JSON

{
"name": "js-sha256",
"version": "1.0.0",
"description": "A simple SHA-256 / SHA-224 hash function for JavaScript supports UTF-8 encoding.",
"main": "build/sha256.node.cjs",
"module": "src/index.mjs",
"exports": {
".": {
"types": "./index.d.ts",
"node": {
"import": "./src/node.mjs",
"require": "./build/sha256.node.cjs"
},
"import": "./src/index.mjs",
"require": "./build/sha256.cjs",
"default": "./src/index.mjs"
},
"./src/sha256.js": "./build/sha256.js",
"./build/sha256.js": "./build/sha256.js",
"./build/sha256.cjs": "./build/sha256.cjs",
"./build/sha256.min.js": "./build/sha256.min.js",
"./build/sha256.min.mjs": "./build/sha256.min.mjs",
"./build/sha256.node.cjs": "./build/sha256.node.cjs",
"./package.json": "./package.json"
},
"types": "./index.d.ts",
"devDependencies": {
"@playwright/test": "^1.62.0",
"@rollup/plugin-terser": "^1.0.0",
"c8": "^8.0.1",
"mocha": "~10.8.2",
"rollup": "^4.43.0"
},
"scripts": {
"test": "npm run build && npm run test:coverage",
"test:unit": "mocha tests/core-test.mjs && mocha tests/node-test.mjs",
"test:dist": "node tests/dist-test.mjs",
"test:runtime": "npm run test:unit && npm run test:dist",
"test:coverage": "c8 --all --include=src/shared.mjs --include=src/core.mjs --include=src/node.mjs --reporter=text --reporter=html --reporter=lcov npm run test:runtime",
"test:browser": "playwright test",
"build": "rollup -c",
"prepack": "npm run build"
},
"repository": {
"type": "git",
"url": "https://github.com/emn178/js-sha256.git"
},
"keywords": [
"sha",
"sha2",
"sha224",
"sha256",
"hash",
"encryption",
"cryptography",
"HMAC"
],
"license": "MIT",
"author": "Chen, Yi-Cyuan <emn178@gmail.com>",
"homepage": "https://github.com/emn178/js-sha256",
"bugs": {
"url": "https://github.com/emn178/js-sha256/issues"
},
"browser": "build/sha256.cjs"
}