Closed Smashman closed 2 years ago
Yeah I'm open to the idea. Anything in particular you had in mind? Is there another library that offers a command line interface
Feel free to continue the convo
I was thinking utilising npx
to one-time convert a gamestate
file.
For example:
npx jomini gamestate stellaris-save-one
Would output the converted contents of the gamestate
file in the current directory to a file named stellaris-save-one.json
in the same place.
The yargs package be used to get arguments passed to the CLI.
Finally, the bin
property of a package.json
desigates a file as executable to npm
. So a .js
file can be passed here and run when npx
is executed.
Let me know if you have further questions.
Thanks for clarifying. I like this idea, and I think this should be implemented. It may not be implemented in this repo as this is more of a wrapper library for js users, and so I think I'd bake the json conversion cli functionality into more of a single toolkit, so it's a one stop shop (and one wouldn't need to worry about having node.js installed to run it).
I created a json subcommand in the toolkit I mentioned: https://github.com/rakaly/cli#conversion-to-json , so that should be enough to get a taste!
I think a command line way of using this library would be an excellent extension.