JGood9001 / rescript-repl

Apache License 2.0
11 stars 0 forks source link

Minimalistic style #1

Open cristianoc opened 1 year ago

cristianoc commented 1 year ago

If the target is JS, perhaps one could bind to a JS cli library. Parser combinators are, fun, but in terms of minimising maintenance one could bind to something shrink wrapped.

JGood9001 commented 1 year ago

Did some reading through NodeJS API docs and found this https://nodejs.org/api/repl.html#replserverdefinecommandkeyword-cmd

This should remove the need for the parser combinators.

And by shrink wrapped, do you mean this? https://docs.npmjs.com/cli/v6/commands/npm-shrinkwrap

cristianoc commented 1 year ago

And by shrink wrapped, do you mean this? https://docs.npmjs.com/cli/v6/commands/npm-shrinkwrap

Sorry all I meant was "ready to go".

JGood9001 commented 1 year ago

And by shrink wrapped, do you mean this? https://docs.npmjs.com/cli/v6/commands/npm-shrinkwrap

Sorry all I meant was "ready to go".

Gotcha, not too surprising there's an npm package with that same name though haha.

I'll work on refactoring it over this week.

JGood9001 commented 1 year ago

Refactored to use the NodeJs API "node:repl" functionality. REPL has an overall cleaner look and feel, including an improvement in the output results from a Js.log. Still need to include tests.