Skip to content

Instantly share code, notes, and snippets.

View AkashBabu's full-sized avatar
💭
busy writing js

Akash Babu AkashBabu

💭
busy writing js
  • Bangalore, Karnataka, India
View GitHub Profile
@portapipe
portapipe / countries.json
Last active April 26, 2024 12:09
Json containing countries name, codes, currency and base64 flags
[{
"id": 1,
"name": "Afghanistan",
"isoAlpha2": "AF",
"isoAlpha3": "AFG",
"isoNumeric": 4,
"currency": {
"code": "AFN",
"name": "Afghani",
"symbol": "؋"
@dchowitz
dchowitz / es6-debugging-in-vscode.md
Last active August 30, 2023 06:23
Debugging ES6 in VS Code

Debugging ES6 in VS Code

My current editor of choice for all things related to Javascript and Node is VS Code, which I highly recommend. The other day I needed to hunt down a bug in one of my tests written in ES6, which at time of writing is not fully supported in Node. Shortly after, I found myself down the rabbit hole of debugging in VS Code and realized this isn't as straightforward as I thought initially. This short post summarizes the steps I took to make debugging ES6 in VS Code frictionless.

What doesn't work

My first approach was a launch configuration in launch.json mimicking tape -r babel-register ./path/to/testfile.js with babel configured to create inline sourcemaps in my package.json. The debugging started but breakpoints and stepping through the code in VS Code were a complete mess. Apparently, ad-hoc transpilation via babel-require-hook and inline sourcemaps do not work in VS Code. The same result for attaching (instead of launch) to `babel-node