From b9a9c2e4cf5cdb354f49dcb0b95653a31c5068e1 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Thu, 8 Feb 2018 16:09:14 -0800 Subject: [PATCH] add node 6 support using babel Fixes #6 --- .babelrc | 5 +++++ .gitignore | 1 + package.json | 9 +++++++-- cmd.js => src/cmd.js | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 .babelrc create mode 100644 .gitignore rename cmd.js => src/cmd.js (99%) diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..59fb020 --- /dev/null +++ b/.babelrc @@ -0,0 +1,5 @@ +{ + "plugins": [ + "@babel/plugin-transform-async-to-generator" + ] +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..849ddff --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +dist/ diff --git a/package.json b/package.json index c1993df..fb6920f 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "email": "feross@feross.org", "url": "https://feross.org" }, - "bin": "cmd.js", + "bin": "dist/cmd.js", "bugs": { "url": "https://github.com/feross/thanks/issues" }, @@ -31,6 +31,9 @@ "text-table": "^0.2.0" }, "devDependencies": { + "@babel/cli": "^7.0.0-beta.39", + "@babel/core": "^7.0.0-beta.39", + "@babel/plugin-transform-async-to-generator": "^7.0.0-beta.39", "standard": "*" }, "keywords": [ @@ -54,6 +57,8 @@ "url": "git://github.com/feross/thanks.git" }, "scripts": { - "test": "standard && ./cmd.js --no-open" + "build": "babel src/cmd.js > dist/cmd.js", + "test": "standard && ./cmd.js --no-open", + "prepublish": "npm run build" } } diff --git a/cmd.js b/src/cmd.js similarity index 99% rename from cmd.js rename to src/cmd.js index 9a2a364..66915fe 100755 --- a/cmd.js +++ b/src/cmd.js @@ -19,7 +19,7 @@ const { readFile } = require('fs') const { stripIndent } = require('common-tags') const PromptConfirm = require('prompt-confirm') -const thanks = require('./') +const thanks = require('../') const readFileAsync = pify(readFile) const readPackageTreeAsync = pify(readPackageTree)