{"version":3,"sources":["jsdelivr-header.js","/npm/vt100@0.2.0/play.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,MAAM,GAAK,QAAQ,MAEb,SAAW,QAAQ,YAEnB,YAAc,CAAC,MAAO,KAAM,aAAa,GAQ/C,SAAS,OAAO,EAAW,GAAI,GAE3B,IAAI,EAEJ,GAHA,EAAU,IAAI,eAAgB,GAGzB,QAAQ,MAAM,MAGd,KAAI,GAAgC,iBAAb,EAIxB,MAAM,IAAI,MAAM,uBAHhB,EAAc,GAAG,iBAAiB,EAItC,MAPI,EAAc,QAAQ,MAa1B,OAJI,EAAQ,aACR,QAAQ,OAAO,MAAM,QAGlB,EACF,KAAK,IAAI,SAAS,EAAQ,OACnC,CAEA,OAAO,QAAU","file":"/npm/vt100@0.2.0/play.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/vt100@0.2.0/play.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","const fs = require('fs');\n\nconst Throttle = require('throttle'); //TODO implement own throttle\n\nconst DEFAULT_OPT = {limit: 1200, clearBefore: true};\n\n/**\n *\n * @param {String} filePath -\n * @param {Object} [options] -\n * @returns {ReadableStream}\n */\nfunction stream(filePath = '', options) {\n    options = {...DEFAULT_OPT, ...options};\n    let inputStream;\n\n    if (!process.stdin.isTTY) { //process was piped\n        inputStream = process.stdin;\n    }\n    else if (filePath && typeof filePath === 'string') {\n        inputStream = fs.createReadStream(filePath);\n    }\n    else {\n        throw new Error('No input was given!');\n    }\n\n    if (options.clearBefore) {\n        process.stdout.write('\\x1B[2J'); //clearing console before starting\n    }\n\n    return inputStream\n        .pipe(new Throttle(options.limit));\n}\n\nmodule.exports = stream;"]}