Skip to content

Commit

Permalink
Require Node.js 18
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Oct 22, 2023
1 parent 2233536 commit 019e111
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ jobs:
fail-fast: false
matrix:
node-version:
- 16
- 20
- 18
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
Expand Down
1 change: 0 additions & 1 deletion browser.d.ts

This file was deleted.

8 changes: 4 additions & 4 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export interface OptionsHexOutput {
export type OptionsHexOutput = {
outputFormat?: 'hex';
}
};

export interface OptionBufferOutput {
export type OptionBufferOutput = {
outputFormat: 'buffer';
}
};

/**
[SHA-1 is insecure](https://stackoverflow.com/a/38045085/64949) and should not be used for anything sensitive.
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,21 @@
},
"type": "module",
"exports": {
"types": "./index.d.ts",
"node": "./index.js",
"default": "./browser.js"
},
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
"node": ">=18"
},
"scripts": {
"test": "xo && ava test.js && karmatic test-browser.js && tsd"
"//test": "xo && ava test.js && karmatic test-browser.js && tsd",
"test": "xo && ava test.js && tsd"
},
"files": [
"index.js",
"index.d.ts",
"browser.js",
"browser.d.ts",
"thread.js"
],
"keywords": [
Expand All @@ -42,11 +43,10 @@
"browser"
],
"devDependencies": {
"@sindresorhus/is": "^4.2.0",
"ava": "^3.15.0",
"@sindresorhus/is": "^6.0.1",
"ava": "^5.3.1",
"hash.js": "^1.1.7",
"karmatic": "2.1.0",
"tsd": "^0.18.0",
"xo": "^0.45.0"
"tsd": "^0.29.0",
"xo": "^0.56.0"
}
}
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
Useful when you want the same hashing API in all environments. My cat calls it *isomorphic*.

In Node.js it uses [`require('crypto')`](https://nodejs.org/api/crypto.html#crypto_class_hash), while in the browser it uses [`window.crypto`](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest).
In Node.js it uses [`node:crypto`](https://nodejs.org/api/crypto.html#crypto_class_hash), while in the browser it uses [`window.crypto`](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest).

The browser version is only ~300 bytes minified & gzipped.

When used in the browser, it must be in a [secure context (HTTPS)](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/subtle).

This package is for modern browsers. IE11 is not supported.
This package is for modern browsers. Internet Explorer is not supported.

## Install

Expand Down

0 comments on commit 019e111

Please sign in to comment.