add package update notifier

This commit is contained in:
2017-06-12 10:56:29 +08:00
parent b6523df7da
commit 0dc80b656c
3 changed files with 8 additions and 3 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "say-it",
"version": "0.1.2",
"version": "0.1.5",
"lockfileVersion": 1,
"dependencies": {
"ajv": {
+3 -2
View File
@@ -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"
}
}
+4
View File
@@ -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', {