File tree 1 file changed +5
-14
lines changed
1 file changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,8 @@ $ npm install read-pubspec
10
10
11
11
## Usage
12
12
13
- ```
14
- import path from 'path';
13
+ ``` js
14
+ import path from ' node: path' ;
15
15
import { readPubspec } from ' read-pubspec' ;
16
16
17
17
process .chdir (path .join (__dirname , ' /test' ));
@@ -21,30 +21,21 @@ console.log(await readPubspec());
21
21
22
22
console .log (await readPubspec ({ cwd: path .join (process .cwd (), ' /sub' ) }));
23
23
// => { name: 'sub', … }
24
-
25
24
```
26
25
27
26
## API
28
27
29
- ### readPubspec(options?, callback?)
30
-
31
- Returns a ` Promise<object> ` with the parsed YAML.
28
+ ### readPubspec(options?)
32
29
33
- Optionally a callback function may be used instead .
30
+ Returns a ` Promise<Pubspec> ` with the parsed YAML .
34
31
35
32
#### options
36
33
37
- Type: ` object `
34
+ Type: ` ReadPubspecOptions `
38
35
39
36
#### options.cwd
40
37
41
38
Type: ` string ` <br >
42
39
Default: ` process.cwd() `
43
40
44
41
Current working directory
45
-
46
- #### callback
47
-
48
- Type: ` Function `
49
-
50
- Optional callback with error as the first argument and the parsed YAML as the second.
You can’t perform that action at this time.
0 commit comments