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 Nov 3, 2023
1 parent 7dfd36b commit 9337d45
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 27 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ jobs:
fail-fast: false
matrix:
node-version:
- 20
- 18
- 16
- 14
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm install
Expand Down
4 changes: 2 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
export interface Options {
export type Options = {
/**
The directory to start searching from.
@default process.cwd()
*/
readonly cwd?: string;
}
};

/**
Find the root directory of a Node.js project or npm package.
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from 'node:path';
import {findUp, findUpSync} from 'find-up';
import {findUp, findUpSync} from 'find-up-simple';

export async function packageDirectory({cwd} = {}) {
const filePath = await findUp('package.json', {cwd});
Expand Down
18 changes: 10 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@
"url": "https://sindresorhus.com"
},
"type": "module",
"exports": "./index.js",
"exports": {
"types": "./index.d.ts",
"default": "./index.js"
},
"engines": {
"node": ">=14.16"
"node": ">=18"
},
"scripts": {
"test": "xo && ava && tsd"
Expand Down Expand Up @@ -47,13 +50,12 @@
"path"
],
"dependencies": {
"find-up": "^6.3.0"
"find-up-simple": "^1.0.0"
},
"devDependencies": {
"ava": "^4.3.1",
"tempy": "^3.0.0",
"tsd": "^0.22.0",
"typescript": "^4.7.4",
"xo": "^0.51.0"
"ava": "^5.3.1",
"tempy": "^3.1.0",
"tsd": "^0.29.0",
"xo": "^0.56.0"
}
}
12 changes: 0 additions & 12 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,3 @@ The directory to start searching from.
- [pkg-dir-cli](https://github.com/sindresorhus/pkg-dir-cli) - CLI for this module
- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file
- [find-up](https://github.com/sindresorhus/find-up) - Find a file by walking up parent directories

---

<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-pkg-dir?utm_source=npm-pkg-dir&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
</b>
<br>
<sub>
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>
</div>

0 comments on commit 9337d45

Please sign in to comment.