Executing any Node.js module or .js file via CLI without creating any command-line interface at all

Written by DiegoZoracKy | Published 2018/01/05
Tech Story Tags: javascript | nodejs | command-line | npm | programming

TLDRvia the TL;DR App

Recently I published MagiCLI, which is a module built to create automagically a CLI for any given module. It's just needed to include it as a dependency, require the module, and then a CLI is ready. However, even though this tool is there, to be used, if a developer (end user) wants to execute some existing module published on npm via CLI, there was still a dependency. The maintainer of a module have to include MagiCLI in order to provide the command-line interface. Well, not anymore πŸ˜‰.

MagiCLI can now be used to execute any module orΒ .js file (containing module.exports) via CLI. Just install it as a global module (or call it using npx) and pass the path to a module or file as an argument. Check the docs to know better about its Usage via CLI.


Published by HackerNoon on 2018/01/05