Giter VIP home page Giter VIP logo

gocsp-st's Introduction

gocsp-st

Stack trace for thunk, promise, callback, etc

Deprecated

It's functionality is built-in for gocsp/thunk.

Usage

var co = require('co')
var fs = require('co-fs')
var st = require('gocsp-st'), st.trace = true

co(function* () {
    try {
        yield fs.readFile('No exist file')
    } catch (err) {
        console.log('w/o st:')
        console.log(err.stack)
    }
    console.log('\n=================================\n')
    try {
        yield st(fs.readFile('No exist file'))
    } catch (err) {
        console.log('w/ st:')
        console.log(err.stack)
    }
})()

will have following output:

$ node --harmony example/co.js
w/o st:
Error: ENOENT, open 'No exist file'
    at Error (native)

=================================

w/ st:
Error: ENOENT, open 'No exist file'
    at Error (native)

---------------------

Error
    at st (/Users/yunsong/Projects/node_modules/gocsp-st/index.js:20:17)
    at /Users/yunsong/Projects/node_modules/gocsp-st/example/co.js:20:15
    at GeneratorFunctionPrototype.throw (native)
    at next (/Users/yunsong/Projects/node_modules/gocsp-st/node_modules/co/index.js:65:26)
    at /Users/yunsong/Projects/node_modules/gocsp-st/node_modules/co/index.js:93:18
    at /Users/yunsong/Projects/node_modules/gocsp-st/node_modules/co-fs/node_modules/thunkify/index.js:28:12
    at fs.js:224:20
    at Object.oncomplete (fs.js:93:15)

gocsp-st's People

Contributors

gyson avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.