Skip to content

Commit

Permalink
Merge pull request #1 from words/fix--wrap-words-on-command-line
Browse files Browse the repository at this point in the history
wrap words on command line
zeke authored Feb 21, 2018
2 parents 4abf094 + c7ab178 commit 377e252
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cli.js
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@

const lookup = require('.')
const query = process.argv.slice(2)
const wrap = require('wordwrap')(80)

async function main() {
if (!query.length) {
@@ -10,7 +11,7 @@ async function main() {
}
const result = await lookup(query)
if (result) {
console.log(result.text)
console.log(wrap(result.text))
} else {
console.log('no results :[')
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -7,7 +7,8 @@
"license": "MIT",
"dependencies": {
"cheerio": "^1.0.0-rc.2",
"got": "^8.1.0"
"got": "^8.1.0",
"wordwrap": "^1.0.0"
},
"devDependencies": {
"jest": "^22.3.0",

0 comments on commit 377e252

Please sign in to comment.