diff --git a/README.md b/README.md index 2e0c862..af29c3b 100644 --- a/README.md +++ b/README.md @@ -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')); @@ -21,20 +21,17 @@ console.log(await readPubspec()); console.log(await readPubspec({ cwd: path.join(process.cwd(), '/sub') })); //=> { name: 'sub', … } - ``` ## API -### readPubspec(options?, callback?) - -Returns a `Promise` with the parsed YAML. +### readPubspec(options?) -Optionally a callback function may be used instead. +Returns a `Promise` with the parsed YAML. #### options -Type: `object` +Type: `ReadPubspecOptions` #### options.cwd @@ -42,9 +39,3 @@ Type: `string`
Default: `process.cwd()` Current working directory - -#### callback - -Type: `Function` - -Optional callback with error as the first argument and the parsed YAML as the second.