arcanis / clipanion

Type-safe CLI library / framework with no runtime dependencies
https://mael.dev/clipanion/
1.1k stars 61 forks source link

Branches the code between browser and node #120

Closed arcanis closed 2 years ago

arcanis commented 2 years ago

The code currently references a few Node builtins that don't make sense within browser contexts. I'd like to be sure that Clipanion can be easily compiled via browsers (I myself use it inside a Chrome extension), so those builtins get in the way.

This diff gates the builtins in a platform folder with a package.json configured to return one file or the other depending on the environment.