Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 790 Bytes

migrate.md

File metadata and controls

26 lines (18 loc) · 790 Bytes

Migration Guide

Migrating from %SOME_TOOL% to Unirepo?

You might need to make some changes.

ts-node, node-dev, ts-node-dev

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.