Skip to content
Permalink
7b4e193ca6
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 17 lines (14 sloc) 375 Bytes
#!/usr/bin/env node
'use strict'
const sentiment = require('sentiment')
const minParam = 3
try {
console.log(process.argv)
if (process.argv.length < minParam) throw new Error('missing parameters')
const words = process.argv.slice(minParam-1).join(' ')
console.log(words)
const result = sentiment(words)
console.log(result)
} catch(err) {
console.log(err.message)
}