File tree Expand file tree Collapse file tree 4 files changed +45
-56
lines changed Expand file tree Collapse file tree 4 files changed +45
-56
lines changed Original file line number Diff line number Diff line change 1- * text =auto
2- * .js text eol =lf
1+ * text =auto eol =lf
Original file line number Diff line number Diff line change 11language : node_js
22node_js :
3+ - ' 10'
34 - ' 8'
45 - ' 6'
5- - ' 4'
Original file line number Diff line number Diff line change 11{
2- "name" : " read-pkg" ,
3- "version" : " 3.0.0" ,
4- "description" : " Read a package.json file" ,
5- "license" : " MIT" ,
6- "repository" : " sindresorhus/read-pkg" ,
7- "author" : {
8- "name" : " Sindre Sorhus" ,
9- 10- "url" : " sindresorhus.com"
11- },
12- "engines" : {
13- "node" : " >=4 "
14- },
15- "scripts" : {
16- "test" : " xo && ava"
17- },
18- "files" : [
19- " index.js"
20- ],
21- "keywords" : [
22- " json" ,
23- " read" ,
24- " parse" ,
25- " file" ,
26- " fs" ,
27- " graceful" ,
28- " load" ,
29- " pkg" ,
30- " package" ,
31- " normalize"
32- ],
33- "dependencies" : {
34- "load-json-file" : " ^4 .0.0" ,
35- "normalize-package-data" : " ^2.3.2" ,
36- "path-type" : " ^3.0.0"
37- },
38- "devDependencies" : {
39- "ava" : " *" ,
40- "xo" : " *"
41- }
2+ "name" : " read-pkg" ,
3+ "version" : " 3.0.0" ,
4+ "description" : " Read a package.json file" ,
5+ "license" : " MIT" ,
6+ "repository" : " sindresorhus/read-pkg" ,
7+ "author" : {
8+ "name" : " Sindre Sorhus" ,
9+ 10+ "url" : " sindresorhus.com"
11+ },
12+ "engines" : {
13+ "node" : " >=6 "
14+ },
15+ "scripts" : {
16+ "test" : " xo && ava"
17+ },
18+ "files" : [
19+ " index.js"
20+ ],
21+ "keywords" : [
22+ " json" ,
23+ " read" ,
24+ " parse" ,
25+ " file" ,
26+ " fs" ,
27+ " graceful" ,
28+ " load" ,
29+ " pkg" ,
30+ " package" ,
31+ " normalize"
32+ ],
33+ "dependencies" : {
34+ "load-json-file" : " ^5 .0.0" ,
35+ "normalize-package-data" : " ^2.3.2" ,
36+ "path-type" : " ^3.0.0"
37+ },
38+ "devDependencies" : {
39+ "ava" : " *" ,
40+ "xo" : " *"
41+ }
4242}
Original file line number Diff line number Diff line change @@ -23,20 +23,10 @@ $ npm install read-pkg
2323``` js
2424const readPkg = require (' read-pkg' );
2525
26- readPkg (). then ( pkg => {
27- console .log (pkg );
26+ ( async () => {
27+ console .log ( await readPkg () );
2828 // => {name: 'read-pkg', ...}
29- });
30-
31- readPkg (__dirname ).then (pkg => {
32- console .log (pkg);
33- // => {name: 'read-pkg', ...}
34- });
35-
36- readPkg (path .join (' unicorn' , ' package.json' )).then (pkg => {
37- console .log (pkg);
38- // => {name: 'read-pkg', ...}
39- });
29+ })();
4030```
4131
4232
You can’t perform that action at this time.
0 commit comments