/
🛠

Five interesting command-line tools

https://eurychen.me/post/5-funny-commands/
climacos
On this page
  • Title
  • Tools

Title

Tools

  • js-fire: a library for automatically generating command line interfaces (CLIs) from most js objects.

A javascript implementation of google/python-fire

ts
const fire = require("js-fire");
const calculator = {
__description__: "I am a math machine",
double: (number) => {
// I double things
return 2 * number;
},
add: (n1 = Math.PI, n2) => {
return n1 + n2;
},
misc: {
year: () => "1999",
brand: () => "casio",
hello: (name) => `hello ${name}`,
},
};
fire(calculator);

A neat effect and perhaps a useful way to show info from CLI tools you might be building. You can configure how the table is rendered, padded, and aligned.

Edit this page
logo
Code-related notes and snippets