Comparing version 4.4.1 to 4.4.2
@@ -6,2 +6,3 @@ 'use strict' | ||
const { extname } = require('path') | ||
const { promisify } = require('util') | ||
const through = require('through2') | ||
@@ -11,4 +12,23 @@ const fs = require('fs') | ||
module.exports = v8LogToTicks | ||
const readFile = promisify(fs.readFile) | ||
const writeFile = promisify(fs.writeFile) | ||
module.exports = wrapper | ||
async function wrapper (isolateLogPath, node) { | ||
const filtered = await filterLinesThatAreTooLong(isolateLogPath) | ||
return v8LogToTicks(filtered, node) | ||
} | ||
// long lines make the --preprocess crash. We are just filtering them beforehand | ||
// as Node.js 8.12.0 would crash if there is any error in the preprocess script | ||
// TODO use streams | ||
async function filterLinesThatAreTooLong (isolateLogPath) { | ||
const dest = isolateLogPath + '.filtered' | ||
let data = await readFile(isolateLogPath, 'utf8') | ||
data = data.split('\n').filter((s) => s.length < 1024).join('\n') | ||
await writeFile(dest, data) | ||
return dest | ||
} | ||
function v8LogToTicks (isolateLogPath, node) { | ||
@@ -28,3 +48,5 @@ const isJson = extname(isolateLogPath) === '.json' | ||
pump(sp.stderr, through((errMsg, _, cb) => { | ||
if (ignore.test(errMsg)) cb() | ||
if (ignore.test(errMsg)) { | ||
cb() | ||
} | ||
else cb(errMsg, _, cb) | ||
@@ -31,0 +53,0 @@ }), process.stderr) |
{ | ||
"name": "0x", | ||
"version": "4.4.1", | ||
"version": "4.4.2", | ||
"description": "🔥 single-command flamegraph profiling 🔥", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
88156
1776