1.4.11 • Published 9 months ago
@jsenv/terminal-recorder v1.4.11
terminal snapshot 
Help to generate beautiful terminal snapshots:
svg
gif
Example
import { writeFileSync } from "node:fs";
import { startTerminalRecording } from "@jsenv/terminal-recorder";
const terminalRecorder = await startTerminalRecording({
svg: {
title: "Terminal",
},
video: true,
gif: true,
});
const datas = [
`[31mred[39m `,
`[33myellow[39m `,
`[32mgreen[39m `,
`[36mcyan[39m `,
`[34mblue[39m `,
`[35mmagenta[39m`,
];
for (const data of datas) {
terminalRecorder.write(data);
await new Promise((resolve) => setTimeout(resolve, 200));
}
const result = await terminalRecorder.stop();
const svg = await result.svg();
writeFileSync(new URL("./terminal.svg", import.meta.url), svg);
const gif = await result.gif();
writeFileSync(new URL("./terminal.gif", import.meta.url), gif);
const webm = await result.webm();
writeFileSync(new URL("./terminal.webm", import.meta.url), webm);
const mp4 = await result.mp4();
writeFileSync(new URL("./terminal.mp4", import.meta.url), mp4);
The animated formats (.gif, .webm, .mp4) are rendered by xterm in chrome headless using playwright. Xterm is used by VsCode integrated terminal, it supports ansi, unicode and so on.
1.4.11
9 months ago
1.4.9
9 months ago
1.4.10
9 months ago
1.2.0
12 months ago
1.1.1
12 months ago
1.1.0
12 months ago
1.4.6
11 months ago
1.3.7
11 months ago
1.1.9
12 months ago
1.4.5
11 months ago
1.3.6
11 months ago
1.4.4
11 months ago
1.3.5
11 months ago
1.1.7
12 months ago
1.4.3
11 months ago
1.3.4
11 months ago
1.1.6
12 months ago
1.4.2
11 months ago
1.3.3
11 months ago
1.1.5
12 months ago
1.4.1
11 months ago
1.3.2
11 months ago
1.1.4
12 months ago
1.4.0
11 months ago
1.3.1
11 months ago
1.2.2
12 months ago
1.1.3
12 months ago
1.3.0
11 months ago
1.2.1
12 months ago
1.1.2
12 months ago
1.0.3
12 months ago
1.1.11
12 months ago
1.1.10
12 months ago
1.4.8
10 months ago
1.4.7
11 months ago
1.0.2
1 year ago
1.0.1
1 year ago
1.0.0
1 year ago