dev-resources.site
for different kinds of informations.
JavaScript in IDE scripting console
Published at
9/18/2024
Categories
jetbrains
javascript
idea
Author
Maksim
Official script example written in JavaScript
function main() {
let sum = 0;
let arr = "35907 77134 453661 175096 23673 29350".split(" ");
arr.forEach((it) => sum += it.length);
com.intellij.openapi.ui.Messages.showInfoMessage((sum / arr.length).toString(), "test");
}
main();
IDEA uses GraalJS to run the script. So you can use interop between JavaScript and Java to access Java objects.
JavaScript runtime also has a global variable IDE which reference an instance of com.intellij.ide.script.IDE
IDE.print("Hello World!")
Articles
12 articles in total
JavaScript in IDE scripting console
currently reading
Note: Setup Prometheus playground
read article
A one story about problem with partitioned table in PostgreSQL
read article
Switch Node.js app to debug mode without restart
read article
VS Code: Debug node.js app in Kubernetes
read article
Compile Clojure to native binary using GraalVM
read article
Install GraalVM on macOS M1
read article
Setup shadow-cljs react project
read article
Visual unit tests
read article
Unit testing JavaScript with Karma. Playwright & Puppeteer
read article
Unit testing JavaScript with Karma in 2021. Starting point
read article
Handling events in React
read article
Featured ones: