I'm new to Node and I'm trying to write a command-line tool in Node that would allow you to pass a string in as an argument.
I saw that Node seems to break each word passed in as an array when using process.argv
. I was wondering if the best way to grab the string is to loop through the array to construct the string or if there was a different option?
So let's say I have a simple program that takes a string and simply console.logs it out. It would look something like this.
> node index.js This is a sentence.
> This is a sentence.