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

Record terminal session. 🏃 📦 🌔 📒

Alternatives: rec, recSync.


asciinema.rec([f], [o], [fn]);
// f:               output filename
// o:               options
// .input:          input javascript file
// .append:         append to file (false)
// .raw:            save in raw format (false)
// .overwrite:      overwrite existing file (true)
// .command:        command to record (cat ${input} | node -i)
// .env:            environment variables
// .title:          file title
// .idleTimeLimit:  maximum idle tile
// fn:              callback function (err, asciicast file)
// --> asciicast file (promise)
const asciinema = require("extra-asciinema");

async function main() {
await asciinema.rec("saved.cast", {input: "example.js"});
// runs example.js interactively in node.js, saves "saved.cast"
}
main();


References

Clone this wiki locally