From d3919a82670fc6d70ae74795f21c100fd5e560c8 Mon Sep 17 00:00:00 2001 From: Avi Vahl Date: Fri, 16 Oct 2020 17:44:10 +0300 Subject: [PATCH] Require Node.js 10 (#9) --- .travis.yml | 2 +- index.d.ts | 19 ++++----- index.js | 2 - package.json | 108 +++++++++++++++++++++++++-------------------------- 4 files changed, 63 insertions(+), 68 deletions(-) diff --git a/.travis.yml b/.travis.yml index f98fed0..9d7745e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: node_js node_js: + - '14' - '12' - '10' - - '8' diff --git a/index.d.ts b/index.d.ts index e339404..3696e88 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,4 +1,12 @@ declare const pkgDir: { + /** + Synchronously find the root directory of a Node.js project or npm package. + + @param cwd - Directory to start from. Default: `process.cwd()`. + @returns The project root path or `undefined` if it couldn't be found. + */ + sync: (cwd?: string) => string | undefined; + /** Find the root directory of a Node.js project or npm package. @@ -28,17 +36,6 @@ declare const pkgDir: { ``` */ (cwd?: string): Promise; - - /** - Synchronously find the root directory of a Node.js project or npm package. - - @param cwd - Directory to start from. Default: `process.cwd()`. - @returns The project root path or `undefined` if it couldn't be found. - */ - sync(cwd?: string): string | undefined; - - // TODO: Remove this for the next major release - default: typeof pkgDir; }; export = pkgDir; diff --git a/index.js b/index.js index 83e683d..0f6b1d1 100644 --- a/index.js +++ b/index.js @@ -8,8 +8,6 @@ const pkgDir = async cwd => { }; module.exports = pkgDir; -// TODO: Remove this for the next major release -module.exports.default = pkgDir; module.exports.sync = cwd => { const filePath = findUp.sync('package.json', {cwd}); diff --git a/package.json b/package.json index aad11e8..12a2413 100644 --- a/package.json +++ b/package.json @@ -1,56 +1,56 @@ { - "name": "pkg-dir", - "version": "4.2.0", - "description": "Find the root directory of a Node.js project or npm package", - "license": "MIT", - "repository": "sindresorhus/pkg-dir", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=8" - }, - "scripts": { - "test": "xo && ava && tsd" - }, - "files": [ - "index.js", - "index.d.ts" - ], - "keywords": [ - "package", - "json", - "root", - "npm", - "entry", - "find", - "up", - "find-up", - "findup", - "look-up", - "look", - "file", - "search", - "match", - "resolve", - "parent", - "parents", - "folder", - "directory", - "dir", - "walk", - "walking", - "path" - ], - "dependencies": { - "find-up": "^4.0.0" - }, - "devDependencies": { - "ava": "^1.4.1", - "tempy": "^0.3.0", - "tsd": "^0.7.2", - "xo": "^0.24.0" - } + "name": "pkg-dir", + "version": "4.2.0", + "description": "Find the root directory of a Node.js project or npm package", + "license": "MIT", + "repository": "sindresorhus/pkg-dir", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "https://sindresorhus.com" + }, + "engines": { + "node": ">=10" + }, + "scripts": { + "test": "xo && ava && tsd" + }, + "files": [ + "index.js", + "index.d.ts" + ], + "keywords": [ + "package", + "json", + "root", + "npm", + "entry", + "find", + "up", + "find-up", + "findup", + "look-up", + "look", + "file", + "search", + "match", + "resolve", + "parent", + "parents", + "folder", + "directory", + "dir", + "walk", + "walking", + "path" + ], + "dependencies": { + "find-up": "^5.0.0" + }, + "devDependencies": { + "ava": "^2.4.0", + "tempy": "^1.0.0", + "tsd": "^0.13.1", + "xo": "^0.33.1" + } }