How to use the pretty-error.start function in pretty-error

To help you get started, we’ve selected a few pretty-error 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 damncabbage / js-compiler-workshop / 07 Parser Combinators / index.js View on Github external
require('pretty-error').start().skipNodeFiles();
const { inspect } = require("util");
const stopHere = () => { console.log("\n\n... Stopping here."); process.exit(0); }


// We're going to use a Parser Combinator library called Eulalie.
const p = require("../support/eulalie");


// This is a parser. It's a value that represents the idea of
// "parsing a string that starts with 'traffic light'":
const trafficLight =
  p.string("traffic light");

// This, too, is a parser. It represents "parsing a string that
// starts with 'The', a space, and then 'traffic light'".
// It is a parser itself: it's made up of other parsers, built
github damncabbage / js-compiler-workshop / 03 Expressive Parsing / index.js View on Github external
require('pretty-error').start().skipNodeFiles();
const { inspect } = require("util");


////////////////////////
//                    //
//     Tokenizer      //
//                    //
////////////////////////

function stringToTokens(input) {
  // Define the shape of tokens to look for.
  // We're using regexps for this because they're good/quick for simple
  // tokenizers; this isn't how all compilers are written. :'D
  const tokenizerRules = [
    {
      regex: /\(/,
github damncabbage / js-compiler-workshop / 08 FP Parsing / index.js View on Github external
require('pretty-error').start().skipNodeFiles();
const { inspect } = require("util");

// Let's pull in Eulalie for the tokeniser.
const p = require("../support/eulalie");


////////////////////////
//                    //
//     Tokenizer      //
//                    //
////////////////////////

function stringToTokens(input) {

  const ignoreResult = parser => p.seq(function*(){
    yield parser;
github damncabbage / js-compiler-workshop / 02 Basic Parsing / index.js View on Github external
require('pretty-error').start().skipNodeFiles();
const { inspect } = require("util");


////////////////////////
//                    //
//     Tokenizer      //
//                    //
////////////////////////

function stringToTokens(input) {
  // Define the shape of tokens to look for.
  // We're using regexps for this because they're good/quick for simple
  // tokenizers; this isn't how all compilers are written. :'D
  const tokenizerRules = [
    {
      regex: /\(/,
github damncabbage / js-compiler-workshop / 06 Let It Be / solution.js View on Github external
require('pretty-error').start().skipNodeFiles();
const { inspect } = require("util");


////////////////////////
//                    //
//     Tokenizer      //
//                    //
////////////////////////

function stringToTokens(input) {
  const tokenizerRules = [
    {
      regex: /let\b/,
      token: "letKeyword"
    },
    {
github c3subtitles / L2S2 / server / src / entry.js View on Github external
});
  });
};

bluebird.promisifyAll(RedisSessions.prototype);
bluebird.promisifyAll(redis.RedisClient.prototype);
bluebird.promisifyAll(redis.Multi.prototype);

UUID.create = function(old) {
  return function() {
    const uuid = old.apply(this, arguments);
    return uuid.hex;
  };
}(UUID.create);
if (process.env.NODE_ENV !== 'production') {
  require('pretty-error').start();
}

global.Promise = bluebird;



global.app = new koa();
let server;
if (process.env.SSLKEY && process.env.SSLCERT) {
  /* eslint-disable no-sync */
  server = https.createServer({
    key: fs.readFileSync(process.env.SSLKEY),
    cert: fs.readFileSync(process.env.SSLCERT),
  }, global.app.callback());
  /* eslint-enable no-sync */
} else {
github ctindel / reader / api / v1.0 / server.js View on Github external
// modules =================================================

//var logger = require("./logger");
var express        = require('express');
require('pretty-error').start();
var bodyParser     = require('body-parser');
var methodOverride = require('method-override');
var mongoose       = require('mongoose');

//logger.debug("Overriding 'Express' logger");

var stormpath = require('express-stormpath');
var routes = require("./app/routes");

var app            = express();

//var morgan = require('morgan')('combined', { "stream": logger.stream });
var morgan = require('morgan');
app.use(morgan('combined'));

// config files
github adlnet / lrs-conformance-test-suite / app.js View on Github external
var express = require('express');
var async = require('async');
var app = express();
var hoganExpress = require('hogan-express');

var testRunner = require('./bin/testRunner.js').testRunner;
require('pretty-error').start();


//dumb in-memory storage for running tests. Replace with a real DB;
var testRunners = [];
//startup, in future might contain more steps
async.series([], function startServer()
{
	//serve static files
	app.use('/static', express.static('public'));
	app.use(require("body-parser").json());
	app.use(require("body-parser").urlencoded(
	{
		extended: true
	}));
	app.use(require("cookie-parser")());
	//use mustache templating
github machawk1 / wail / src / loadingScreens / firstTime / loadingScreen.js View on Github external
import 'babel-polyfill'
import React from 'react'
import ReactDOM from 'react-dom'
import injectTapEventPlugin from 'react-tap-event-plugin'
import LoadingProgress from './fLoadingProgress'
require('pretty-error').start()

window.React = React

injectTapEventPlugin()

ReactDOM.render(
  ,
  document.getElementById('loading'))
github findmypast-oss / jackal / cli / index.js View on Github external
#! /usr/bin/env node

'use strict'

const client = require('../client')
const reporter = require('./reporter')
const prettyError = require('pretty-error').start()

const dump = (jackalUrl, options) => {
  client.dump(
    jackalUrl,
    reporter(['json', 'pretty'], options.reporter, exitCodeHandler)
  )
}

const run = (jackalUrl, providerName, options) => {
  client.run(
    jackalUrl,
    providerName,
    options,
    reporter(['spec', 'teamcity', 'json'], options.reporter, exitCodeHandler)
  )
}

pretty-error

See nodejs errors with less clutter

MIT
Latest version published 3 years ago

Package Health Score

67 / 100
Full package analysis