/ javascript

Parse the command line with ease using Minimist

Sometimes you come across a tool that is so fit for the job that you don't bother looking for anything else after you use it once. A lot of Unix tools fit this mold. These tools usually have a well defined problem and execute it beautifully. They do one thing and they do it well. It makes the easy things easy but the hard things still possible.

Whenever I need to parse command line arguments, the gold standard to me is mimimist. All you need is a list of arguments and it parses it out into an easily understandable and common data structure. You practically don't even need to read the docs to know how to use it.