-
Notifications
You must be signed in to change notification settings - Fork 2
/
help.ts
39 lines (28 loc) · 1.05 KB
/
help.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
export function getHelpText(version: string) {
return `\
deno2node: Compile Deno code for Node - Version ${version}
${bold("COMMON COMMANDS")}
${blue("deno2node")}
Compiles the current project (tsconfig.json in the working directory.)
${blue("deno2node --project <tsconfig.json>")}
Compiles the current project with the specified tsconfig.json file.
${blue("deno2node --init")}
Creates a tsconfig.json with the recommended settings in the working directory.
${bold("COMMAND LINE FLAGS")}
${blue(" --help, -h ")}Print this message.
${blue(" --version, -v ")}Print the CLI's version.
${blue(" --init ")}Initializes a deno2node project \
and creates a tsconfig.json file.
You can learn about the compiler options at https://aka.ms/tsc
`;
}
export const useColors = Deno.stdout.isTerminal() && !Deno.noColor;
function bold(text: string) {
return format(text, 1);
}
function blue(text: string) {
return format(text, 34);
}
function format(text: string, ansi: number) {
return useColors ? `\u001b[${ansi}m${text}\u001b[0m` : text;
}