Skip to content

Commit

Permalink
fix(refactor): replace console.error with process.stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
watilde committed Aug 3, 2017
1 parent e12d136 commit ad5df92
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions bin/dep.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ const pkgJSON = require('../package.json')
const notifier = updateNotifier({pkg: pkgJSON})

if (!semver.satisfies(process.version, pkgJSON.engine.node)) {
console.error('dep works only on Node.js LTS versions')
console.error('See the schedule: https://github.com/nodejs/LTS#lts-schedule1')
process.stderr.write('dep works only on Node.js LTS versions\n')
process.stderr.write('See the schedule: https://github.com/nodejs/LTS#lts-schedule1\n')
process.exit(1)
}

Expand Down
4 changes: 2 additions & 2 deletions lib/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ const install = (argv) => {
process.stdout.write(
`Installed ${global.dependenciesCount} packages in ${s}s\n`
)
}).catch(console.error)
}).catch(console.error)
}).catch((e) => { process.stderr(e.stack) })
}).catch((e) => { process.stderr(e.stack) })
}

module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion lib/lock.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const lock = (argv) => {
process.stdout.write(
`created node_modules.json\n`
)
}).catch(console.error)
}).catch((e) => { process.stderr(e.stack) })
}

module.exports = {
Expand Down

0 comments on commit ad5df92

Please sign in to comment.