Skip to content

retimeData

Subhajit Sahu edited this page Feb 3, 2021 · 8 revisions

Updates time in asciicast data. ๐Ÿ“ฆ ๐Ÿ˜บ ๐Ÿƒ ๐Ÿ“ผ ๐ŸŒ” ๐Ÿ“œ ๐Ÿ“ฐ ๐Ÿ“˜

Alternatives: retime, retimeSync, retimeData.


asciinema.retimeData(d, [o]);
// d:             asciicast data
// o:             options
// .input:        input text
// .inputRate:    input rate (0.1s)
// .inputDelay:   input delay (1s)
// .outputRate:   output rate (0.1s)
// .outputDelay:  output delay (0.1s)
// .delay:        initial delay (0s)
// โ†’ updated asciicast data
const asciinema = require("extra-asciinema");
const fs = require("fs");

var d = fs.readFileSync("saved.cast", "utf8");
d = asciinema.retimeData(d, {inputDelay: 2});
fs.writeFileSync("saved.cast", d);
// "saved.cast" is updated


References

Clone this wiki locally