Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] cwd option #30

Merged
merged 5 commits into from
Feb 3, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# main (unreleased)
- [feature]: Add the ability to perform the check in the specified path

# 0.2.0
- [[feature]: add links to the GitHub repo to be able to navigate from the npm package page](https://github.com/upgradejs/depngn/pull/27)
Expand Down
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ npx depngn 14.17.6 --reporter=json

- `--reporter`
- `--help`
- `--cwd`

#### `--cwd`

Specify the path where you want the check to be performed

#### `--reporter`

Expand Down Expand Up @@ -60,8 +65,16 @@ The `engines` field in `package.json` is optional and many libraries don't inclu
## Standalone Package

You can also import `depngn` as a standalone function to use in your own CLI
tools. It takes one argument: `nodeVersion: string`, and it returns a promise
that resolves to:
tools. It takes an object as an argument:

```typescript
interface Options {
version: string;
cwd: string | undefined;
}
```

And it returns a promise that resolves to:

```typescript
type DepngnReturn = Record<string, CompatData>;
Expand All @@ -78,7 +91,7 @@ interface CompatData {
import { depngn } from 'depngn';

const generateReport = async () => {
return await depngn('10.0.0');
return await depngn({ version: '10.0.0' });
};
```

Expand Down
Loading