opts.js is a Javascript helper library for command-line applications, for accepting and parsing command-line arguments, flags and options, and automatically generating a useful help message. Introduction to Opts.js Why choose opts.js over something bigger and better? Small : Under 10kb, uncompressed. Stable : Relatively unchanged since 2010. See changelog. Standalone : No package manager necessary, no compiling needed. See src/opts.js. Tested : Millions of downloads per year. See npm/opts. Quick-Start example The following example set up a custom "version" function, and opts in to the automatic help message.
Introduction Useful when converting a list of file names into a nested UL/LI tree. Perfect for site maps, and directory listings. Provide a list of file names: blog/all.html blog/2036/overflows.html And recieve a directory-like tree: blog all.html 2036 overflows.html Installation Install it with NPM: npm install --save treeify-paths Import with modern syntax: import treeifyPaths from "treeify-paths"; Or if you are not using NPM, install the library by downloading the source file directly and including it in your project:
Building your own live-reloading web server Follow along and build your own automatically-refreshing web server, as shown here: This setup assumes you know and use Node and NPM You are editing HTML, CSS, and Javascript by hand, because you like it. You've had some of that hot-reloading goodness before, and you want it now, too. You don't feel like spending the weekend reading Webpack docs, so you decide that it should only take a few dozen lines of Javascript, at most, to roll your own.