derhuerst/asciicast-to-svg

Support Asciicast v2 format

Open

#6 opened on Aug 14, 2018

View on GitHub
 (3 comments) (0 reactions) (0 assignees)JavaScript (2 forks)github user discovery
Hacktoberfestenhancementhelp wanted

Repository metrics

Stars
 (44 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

I always get the same error with the CLI:

SyntaxError: Unexpected token [ in JSON at position 125
    at JSON.parse (<anonymous>)
    at Socket.process.stdin.on.on.once (/Users/felix/src/ps-nvm/vs/v10.8.0/lib/node_modules/asciicast-to-svg/cli.js:44:20)
    at Object.onceWrapper (events.js:273:13)
    at Socket.emit (events.js:187:15)
    at endReadableNT (_stream_readable.js:1081:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

cast file:

{"version": 2, "width": 160, "height": 40, "timestamp": 1534244114, "env": {"SHELL": "/bin/bash", "TERM": "xterm-256color"}}
[0.010865, "o", "\u001b[?1034hbash-3.2$ "]
[1.861431, "o", "e"]
[1.979978, "o", "c"]
[2.092802, "o", "h"]
[2.244695, "o", "o"]
[2.348721, "o", " "]
[2.445007, "o", "t"]
[2.507652, "o", "e"]
[2.669375, "o", "s"]
[2.805007, "o", "t"]
[3.469918, "o", "\r\n"]
[3.470138, "o", "test\r\nbash-3.2$ "]
[4.58894, "o", "e"]
[4.78088, "o", "x"]
[4.918007, "o", "i"]
[4.964743, "o", "t"]
[5.196836, "o", "\r\n"]
[5.19714, "o", "exit\r\n"]

Command I run:

cat test.cast | asciicast-to-svg 0 > test.svg

Contributor guide