From 1e22fad74d26bba3ea71fd34d2f9224cc5dd1b6b Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Sat, 4 Nov 2023 16:28:14 +0700 Subject: [PATCH] Rename package from `read-pkg-up` to `read-package-up` --- index.d.ts | 13 ++++++++++--- package.json | 4 ++-- readme.md | 8 ++++---- test.js | 4 ++-- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/index.d.ts b/index.d.ts index 5cb06c6..f4097f9 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,5 +1,12 @@ import {type Except} from 'type-fest'; -import {readPackage, readPackageSync, type Options as ReadPackageOptions, type NormalizeOptions as ReadPackageNormalizeOptions, type PackageJson, type NormalizedPackageJson} from 'read-pkg'; +import { + readPackage, + readPackageSync, + type Options as ReadPackageOptions, + type NormalizeOptions as ReadPackageNormalizeOptions, + type PackageJson, + type NormalizedPackageJson, +} from 'read-pkg'; export type Options = { /** @@ -34,7 +41,7 @@ Read the closest `package.json` file. @example ``` -import {readPackageUp} from 'read-pkg-up'; +import {readPackageUp} from 'read-package-up'; console.log(await readPackageUp()); // { @@ -55,7 +62,7 @@ Synchronously read the closest `package.json` file. @example ``` -import {readPackageUpSync} from 'read-pkg-up'; +import {readPackageUpSync} from 'read-package-up'; console.log(readPackageUpSync()); // { diff --git a/package.json b/package.json index c9341b7..cd3c5cf 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { - "name": "read-pkg-up", + "name": "read-package-up", "version": "10.1.0", "description": "Read the closest package.json file", "license": "MIT", - "repository": "sindresorhus/read-pkg-up", + "repository": "sindresorhus/read-package-up", "funding": "https://github.com/sponsors/sindresorhus", "author": { "name": "Sindre Sorhus", diff --git a/readme.md b/readme.md index 87ef965..0d52441 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -# read-pkg-up +# read-package-up > Read the closest package.json file @@ -11,13 +11,13 @@ ## Install ```sh -npm install read-pkg-up +npm install read-package-up ``` ## Usage ```js -import {readPackageUp} from 'read-pkg-up'; +import {readPackageUp} from 'read-package-up'; console.log(await readPackageUp()); /* @@ -63,6 +63,6 @@ Default: `true` ## Related - [read-pkg](https://github.com/sindresorhus/read-pkg) - Read a package.json file -- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file +- [package-up](https://github.com/sindresorhus/package-up) - Find the closest package.json file - [find-up](https://github.com/sindresorhus/find-up) - Find a file by walking up parent directories - [pkg-conf](https://github.com/sindresorhus/pkg-conf) - Get namespaced config from the closest package.json diff --git a/test.js b/test.js index c17d4e1..3a93792 100644 --- a/test.js +++ b/test.js @@ -7,7 +7,7 @@ const packagePath = path.resolve('.', 'package.json'); test('async', async t => { const result = await readPackageUp({cwd}); - t.is(result.packageJson.name, 'read-pkg-up'); + t.is(result.packageJson.name, 'read-package-up'); t.is(result.path, packagePath); t.deepEqual( await readPackageUp({cwd: new URL(cwd, import.meta.url)}), @@ -19,7 +19,7 @@ test('async', async t => { test('sync', t => { const result = readPackageUpSync({cwd}); - t.is(result.packageJson.name, 'read-pkg-up'); + t.is(result.packageJson.name, 'read-package-up'); t.is(result.path, packagePath); t.deepEqual( readPackageUpSync({cwd: new URL(cwd, import.meta.url)}),