How to use the extract-stack.lines function in extract-stack

To help you get started, we’ve selected a few extract-stack examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github foundation / panini / lib / engine.js View on Github external
error(error, filePath) {
    const fileName = path.relative(process.cwd(), filePath);
    if (!errorTemplate) {
      const errorPage = fs.readFileSync(path.join(__dirname, 'error-template.hbs'));
      errorTemplate = Handlebars.compile(errorPage.toString());
    }

    return errorTemplate({
      message: error.message,
      stack: extractStack.lines(error).join('\n'),
      fileName
    });
  }
}

extract-stack

Extract the actual stack of an error

MIT
Latest version published 3 years ago

Package Health Score

68 / 100
Full package analysis

Popular extract-stack functions