Insight.js was designed to work anywhere JavaScript runs. It leverages the widespread adoption of the Babel compiler ecosystem to instrument your code, then uses a runtime to beam evaluation records back to VSCode over a localhost WebSocket.
As of now, Insight.js has been tested (code samples here) with Node.js, Vue, Webpack, Create React App, Next.js, Jest, Vite, and Ionic (and Svelte is WIP), with plenty more integrations on the way.
Simply run Insight: Start App Monitor
from the Command Paulette. (You can configure the App Monitor to auto-start in your VSCode settings)
@insight-js/kit
)npm install -D @insight-js/kit # or yarn, pnpm, etc
Note: Insight ships with code to ease integrating with Node.js and Jest, see below for examples.
You'll want your .babelrc
to resemble something like below.
{
"env": {
"development": {
"plugins": ["@insight-js/kit/babel-client"]
}
}
}
That's it!
Insight provides a helper runtime for Node.js, you can load it by importing @insight-js/kit/node
, or simply pre-require it with Node's require flag node -r @insight-js/kit/node [your node app]
.
To get Insight.js working with Jest, you'll need to direct Jest to use a custom Babel configuration, as well as a special test environment. Check out the Jest example.