In this article, we’ll go over the concepts and techniques required to build a command line tool using Node.js and PhantomJS . Building a command line tool enables you to automate a process that would otherwise take a lot longer. Command line tools are built in a myriad of languages, but the one we’ll focus on is Node.js. What We’ll Cover Secret sauce Installing Node.js and npm Process Automation PhantomJS Squirrel How it works The code Packaging Publishing Conclusion Secret Sauce For those short on time, I’ve condensed the core process into three steps. This is the secret sauce to convert your Node.js script into a fully functioning command line tool. But do stick around to see what else I have to show you. In your package.json file, include the following settings: "preferGlobal": "true" "bin": { "name-of-command": "path-to-script.js" } Add #!/usr/bin/env node to path-to-script.js
↧