Skip to content

Instantly share code, notes, and snippets.

View LeoUrzua's full-sized avatar
🎯
Focusing

Leonardo Urzua LeoUrzua

🎯
Focusing
View GitHub Profile
--log_gc (Log heap samples on garbage collection for the hp2ps tool.)
type: bool default: false
--expose_gc (expose gc extension)
type: bool default: false
--max_new_space_size (max size of the new generation (in kBytes))
type: int default: 0
--max_old_space_size (max size of the old generation (in Mbytes))
type: int default: 0
--max_executable_size (max size of executable memory (in Mbytes))
type: int default: 0
const { createServer } = require('http');
const { stat, createReadStream } = require('fs');
const { promisify } = require('util');
const fileName = './a.mkv'; // name of the file with the format included
const fileInfo = promisify(stat);
createServer(async (req, res) => {
const { size } = await fileInfo(fileName);
const range = req.headers.range;
if (range) {