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 4, 2023
1 parent 78730d5 commit b902cd5
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 17 deletions.
4 changes: 4 additions & 0 deletions .github/funding.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
github: sindresorhus
open_collective: sindresorhus
tidelift: npm/pkg-up
custom: https://sindresorhus.com/donate
3 changes: 3 additions & 0 deletions .github/security.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Security Policy

To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure.
9 changes: 4 additions & 5 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:
- 16
- 14
- 12
- 20
- 18
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- 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 from.
@default process.cwd()
*/
readonly cwd?: string;
}
};

/**
Find the closest `package.json` file.
Expand Down
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import {findUp, findUpSync} from 'find-up';
import process from 'node:process';
import {findUp, findUpSync} from 'find-up-simple';

export async function pkgUp({cwd} = {}) {
export async function pkgUp({cwd = process.cwd()} = {}) {
return findUp('package.json', {cwd});
}

export function pkgUpSync({cwd} = {}) {
export function pkgUpSync({cwd = process.cwd()} = {}) {
return findUpSync('package.json', {cwd});
}
15 changes: 9 additions & 6 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": "^12.20.0 || ^14.13.1 || >=16.0.0"
"node": ">=18"
},
"scripts": {
"test": "xo && ava && tsd"
Expand Down Expand Up @@ -44,11 +47,11 @@
"path"
],
"dependencies": {
"find-up": "^6.2.0"
"find-up-simple": "^1.0.0"
},
"devDependencies": {
"ava": "^3.15.0",
"tsd": "^0.18.0",
"xo": "^0.46.4"
"ava": "^5.3.1",
"tsd": "^0.29.0",
"xo": "^0.56.0"
}
}
2 changes: 1 addition & 1 deletion test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'node:path';
import test from 'ava';
import {fileURLToPath} from 'node:url';
import test from 'ava';
import {pkgUp, pkgUpSync} from './index.js';

const __dirname = path.dirname(fileURLToPath(import.meta.url));
Expand Down

0 comments on commit b902cd5

Please sign in to comment.