How to use extract-stack - 2 common examples

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 jamiebuilds / naw / src / cli.ts View on Github external
.catch(err => {
		finalError = err

		if (err instanceof ProcessError && err.code === 1) {

		let [type] = err.stack.match(ERROR_TYPE_REGEX)
		let message = replaceAll(err.message, /"(.*?)"/g, chalk.cyan('"$1"'))
		let stack = chalk.italic(extractStack(err))

		println("{ %s}{bold %s}\n{dim %s}", type, message, stack)
	.then(() => {
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'),


Extract the actual stack of an error

Latest version published 2 years ago

Package Health Score

70 / 100
Full package analysis

Popular extract-stack functions

Popular JavaScript code snippets

Find secure code to use in your application or website