npx is an useful tool to run one-off commands like create-react-app
, http-server
etc.
In this post I’ll go through the steps needed to create a command line tool that can be invoked using npx.
Let’s start with a simple hello world script
console.log("hello world");
This prints “hello world” when you run it
$ node index.js
hello world
#npm #npx #node #developer