Migrating from %SOME_TOOL% to Unirepo?
You might need to make some changes.
Instead of ts-node ./path/to/script.ts
, use uni run ./path/to/module.ts
.
The module must export a main
function. For example:
export const main = async (...args: string[]) => {
console.log("see uni run");
return 0; // Return an exit code (optional).
};
This is because uni run
does not make a distinction between modules and
scripts; there are only modules. It should always be safe and side-effect free
to load a (trusted) module.
Note that run processes will terminate as soon as the main function returns. This differs from Node's default behavior where a non-empty event loop will keep the program alive indefinitely.