From c5f6837641de06bd5e294b1060dd381e53f56799 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Mon, 25 Jun 2018 21:55:12 +0700 Subject: [PATCH] Require Node.js 6 --- .gitattributes | 3 +- .travis.yml | 2 +- package.json | 80 +++++++++++++++++++++++++------------------------- readme.md | 16 ++-------- 4 files changed, 45 insertions(+), 56 deletions(-) diff --git a/.gitattributes b/.gitattributes index 391f0a4..6313b56 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1 @@ -* text=auto -*.js text eol=lf +* text=auto eol=lf diff --git a/.travis.yml b/.travis.yml index 7d69d74..2ae9d62 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: node_js node_js: + - '10' - '8' - '6' - - '4' diff --git a/package.json b/package.json index 1a40fe0..065172d 100644 --- a/package.json +++ b/package.json @@ -1,42 +1,42 @@ { - "name": "read-pkg", - "version": "3.0.0", - "description": "Read a package.json file", - "license": "MIT", - "repository": "sindresorhus/read-pkg", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=4" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js" - ], - "keywords": [ - "json", - "read", - "parse", - "file", - "fs", - "graceful", - "load", - "pkg", - "package", - "normalize" - ], - "dependencies": { - "load-json-file": "^4.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^3.0.0" - }, - "devDependencies": { - "ava": "*", - "xo": "*" - } + "name": "read-pkg", + "version": "3.0.0", + "description": "Read a package.json file", + "license": "MIT", + "repository": "sindresorhus/read-pkg", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "engines": { + "node": ">=6" + }, + "scripts": { + "test": "xo && ava" + }, + "files": [ + "index.js" + ], + "keywords": [ + "json", + "read", + "parse", + "file", + "fs", + "graceful", + "load", + "pkg", + "package", + "normalize" + ], + "dependencies": { + "load-json-file": "^5.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + }, + "devDependencies": { + "ava": "*", + "xo": "*" + } } diff --git a/readme.md b/readme.md index 6875067..4263ea7 100644 --- a/readme.md +++ b/readme.md @@ -23,20 +23,10 @@ $ npm install read-pkg ```js const readPkg = require('read-pkg'); -readPkg().then(pkg => { - console.log(pkg); +(async () => { + console.log( await readPkg()); //=> {name: 'read-pkg', ...} -}); - -readPkg(__dirname).then(pkg => { - console.log(pkg); - //=> {name: 'read-pkg', ...} -}); - -readPkg(path.join('unicorn', 'package.json')).then(pkg => { - console.log(pkg); - //=> {name: 'read-pkg', ...} -}); +})(); ```