Skip to content

Commit

Permalink
Rename package from read-pkg-up to read-package-up
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Nov 4, 2023
1 parent 935a546 commit 1e22fad
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
13 changes: 10 additions & 3 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -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 = {
/**
Expand Down Expand Up @@ -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());
// {
Expand All @@ -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());
// {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
8 changes: 4 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# read-pkg-up
# read-package-up

> Read the closest package.json file
Expand All @@ -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());
/*
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)}),
Expand All @@ -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)}),
Expand Down

0 comments on commit 1e22fad

Please sign in to comment.