Skip to content

Commit

Permalink
Rename package from pkg-conf to package-config
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Nov 5, 2023
1 parent f7000a1 commit ee366eb
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ It [walks up](https://github.com/sindresorhus/find-up-simple) parent directories
// }
// }
import {packageConfig} from 'pkg-conf';
import {packageConfig} from 'package-config';
const config = await packageConfig('unicorn');
Expand Down Expand Up @@ -79,7 +79,7 @@ It [walks up](https://github.com/sindresorhus/find-up-simple) parent directories
// }
// }
import {packageConfigSync} from 'pkg-conf';
import {packageConfigSync} from 'package-config';
const config = packageConfigSync('unicorn');
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": "pkg-conf",
"name": "package-config",
"version": "4.0.0",
"description": "Get namespaced config from the closest package.json",
"license": "MIT",
"repository": "sindresorhus/pkg-conf",
"repository": "sindresorhus/package-config",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
Expand Down
6 changes: 3 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# pkg-conf
# package-config

> Get namespaced config from the closest package.json
Expand All @@ -7,7 +7,7 @@ Having tool specific config in package.json reduces the amount of metafiles in y
## Install

```sh
npm install pkg-conf
npm install package-config
```

## Usage
Expand All @@ -23,7 +23,7 @@ npm install pkg-conf
```

```js
import {packageConfig} from 'pkg-conf';
import {packageConfig} from 'package-config';

const config = await packageConfig('unicorn');

Expand Down
14 changes: 7 additions & 7 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));

const cwd = path.join(__dirname, 'fixture');
const nestedCwd = path.join(cwd, 'nested');
const pkgPath = path.join(__dirname, 'package.json');
const pacagePath = path.join(__dirname, 'package.json');
const nestedPath = path.join(nestedCwd, 'package.json');

test('async', async t => {
const config = await packageConfig('fixture', {cwd});
t.true(config.foo);
t.is(packageJsonPath(config), pkgPath);
t.is(packageJsonPath(config), pacagePath);
});

test('async - non-existent namespace', async t => {
Expand All @@ -24,7 +24,7 @@ test('async - non-existent namespace', async t => {
test('sync', t => {
const config = packageConfigSync('fixture', {cwd});
t.true(config.foo);
t.is(packageJsonPath(config), pkgPath);
t.is(packageJsonPath(config), pacagePath);
});

test('sync - non-existent namespace', t => {
Expand Down Expand Up @@ -58,7 +58,7 @@ test('async - nested skipOnFalse', async t => {
});

t.true(config.foo);
t.is(packageJsonPath(config), pkgPath);
t.is(packageJsonPath(config), pacagePath);
});

test('async - normal skipOnFalse', async t => {
Expand All @@ -68,7 +68,7 @@ test('async - normal skipOnFalse', async t => {
});

t.true(config.foo);
t.is(packageJsonPath(config), pkgPath);
t.is(packageJsonPath(config), pacagePath);
});

test('sync - nested default', t => {
Expand All @@ -88,7 +88,7 @@ test('sync - nested skipOnFalse', t => {
});

t.true(config.foo);
t.is(packageJsonPath(config), pkgPath);
t.is(packageJsonPath(config), pacagePath);
});

test('sync - normal skipOnFalse', t => {
Expand All @@ -98,5 +98,5 @@ test('sync - normal skipOnFalse', t => {
});

t.true(config.foo);
t.is(packageJsonPath(config), pkgPath);
t.is(packageJsonPath(config), pacagePath);
});

0 comments on commit ee366eb

Please sign in to comment.