Run run is a cli to quickly test a library, either in typescript or js. Most of libraries don't expose a executable method to test in cli, and rr
is here to solve
- Add
rr
to dev dependencies like -yarn install @silenteer/run
- Can use
yarn rr -h
to see options
yarn rr ./index.ts
to call default export function without any parametersyarn rr ./index.ts --at echo -a 'Hello world'
to call methodecho
of the export withHello world
as an argument. Argument can be added multiple timesyarn rr ./index.ts --at echo.start
to execute method start of the export of theecho
instance
Argument employs a simple syntax to determine data type. These are supported data types for argument
s:<string value>
will be use as string valuen:<string value>
will be put toNumber
b:<string value>
will be put toBoolean
j:<string value>
will be put toJSON.parse
Promise will be handled accordingly so you don't have to write a file just to wrap the first level await async