Skip to content

Commit

Permalink
fix: Update README to remove references to callback function
Browse files Browse the repository at this point in the history
  • Loading branch information
kirkeaton committed Dec 25, 2024
1 parent 527d858 commit 14e3555
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ $ npm install read-pubspec

## Usage

```
import path from 'path';
```js
import path from 'node:path';
import { readPubspec } from 'read-pubspec';

process.chdir(path.join(__dirname, '/test'));
Expand All @@ -21,30 +21,21 @@ console.log(await readPubspec());

console.log(await readPubspec({ cwd: path.join(process.cwd(), '/sub') }));
//=> { name: 'sub', … }
```

## API

### readPubspec(options?, callback?)

Returns a `Promise<object>` with the parsed YAML.
### readPubspec(options?)

Optionally a callback function may be used instead.
Returns a `Promise<Pubspec>` with the parsed YAML.

#### options

Type: `object`
Type: `ReadPubspecOptions`

#### options.cwd

Type: `string`<br>
Default: `process.cwd()`

Current working directory

#### callback

Type: `Function`

Optional callback with error as the first argument and the parsed YAML as the second.

0 comments on commit 14e3555

Please sign in to comment.