The current implementation of OPJS uses a singleton approach, and while it's generally fine it's sort of an awkward pattern to be using for a JS client for a CLI. It also prohibits multiple instances of the client.
This PR rewrites the codebase so that it's class-based. Specifically:
You'll now import and instantiate the main OPJS class
Under the hood, it uses a Command class for executing commands, as well as a Flag class to register and construct flags
The codebase is much more organized, and tests are more thorough
Closes https://github.com/1Password/op-js/issues/76
The current implementation of OPJS uses a singleton approach, and while it's generally fine it's sort of an awkward pattern to be using for a JS client for a CLI. It also prohibits multiple instances of the client.
This PR rewrites the codebase so that it's class-based. Specifically:
OPJS
classCommand
class for executing commands, as well as aFlag
class to register and construct flags