Skip to content

Instantly share code, notes, and snippets.

@focusaurus
Created January 28, 2016 06:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save focusaurus/bff56d373fdea0d2eca1 to your computer and use it in GitHub Desktop.
Save focusaurus/bff56d373fdea0d2eca1 to your computer and use it in GitHub Desktop.
iron-node and babel step through
{
"presets": ["es2015", "stage-0"],
"plugins": [
"transform-decorators-legacy",
"transform-export-extensions"
]
}
{
"author": "Peter Lyons <pete@peterlyons.com> (http://peterlyons.com/)",
"license": "MIT",
"name": "SET_NAME_HERE",
"private": true,
"version": "1.0.0",
"dependencies": {
"babel-core": "6.4.5",
"babel-plugin-transform-decorators-legacy": "1.3.4",
"babel-plugin-transform-export-extensions": "6.4.0",
"babel-plugin-transform-regenerator": "6.4.4",
"babel-polyfill": "6.3.14",
"babel-preset-es2015": "6.3.13",
"babel-preset-stage-0": "6.3.13",
"babel-register": "6.4.3",
"babel-runtime": "6.3.19",
"iron-node": "2.1.13"
}
}
import http from 'http'
export async function load (url) {
return new Promise(function (resolve, reject) {
http.get(url, function (res) {
var chunks = []
res.on('data', chunk => chunks.push(chunk.toString()))
res.on('end', () => resolve(chunks.join()))
})
})
}
async function main() {
console.log('Put a dynamic breakpoint on this line')
// I cannot find a combination of "Step Over" or in/out
// that will get me to the line after the await
const html = await load('http://www.google.com')
console.log(html)
console.log("you cannot step to this line")
console.log("once you've hit an 'await', can't step through")
}
// You seem to need to always have an initial debugger statement somewher
debugger;
main()
require("babel-register")
require('babel-polyfill')
require('./stage0')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment