diff --git a/package-lock.json b/package-lock.json index 275df38..4c944d9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "say-it", - "version": "0.1.2", + "version": "0.1.5", "lockfileVersion": 1, "dependencies": { "ajv": { diff --git a/package.json b/package.json index aef0541..ab53400 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "say-it", - "version": "0.1.4", + "version": "0.1.5", "description": "Read the text you typed in command line by using Baidu tts.", "main": "say-it.js", "bin": { @@ -30,6 +30,7 @@ "inquirer": "^3.0.6", "lodash": "^4.17.4", "play-sound": "^1.1.1", - "request": "^2.81.0" + "request": "^2.81.0", + "update-notifier": "^2.2.0" } } diff --git a/say-it.js b/say-it.js index 0ab6bfe..7d02302 100755 --- a/say-it.js +++ b/say-it.js @@ -10,6 +10,8 @@ const player = require('play-sound')(opts = { const charm = require('charm')() const TEXTS = require('./texts') const _ = require('lodash') +const updateNotifier = require('update-notifier'); +const pkg = require('./package.json'); const showError = (error = TEXTS.error) => { console.log(chalk.red(error)) @@ -19,6 +21,8 @@ var person = 0 charm.pipe(process.stdout); +updateNotifier({pkg}).notify(); //show npm package update if available + program .version('0.1') .command(' ', 'read the texts you typed in', {