Skip to content

retimeData

wolfram77 edited this page Apr 4, 2020 · 8 revisions

Updates time in asciicast data.

asciinema.retimeData(d, o, [o.input], [o.inputRate], [o.inputDelay], [o.outputRate], [o.outputDelay], [o.delay]);
// 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