# Is there any tool outside that allows me to write JavaScript code as Scripts?

**URL:** <https://discuss.elastic.co/t/is-there-any-tool-outside-that-allows-me-to-write-javascript-code-as-scripts/361281>\
**Category:** Elasticsearch\
**Tags:** painless\
**Created:** [June 11, 2024, 4:27pm UTC](https://discuss.elastic.co/t/is-there-any-tool-outside-that-allows-me-to-write-javascript-code-as-scripts/361281 "2024-06-11T16:27:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Edy\_Silva](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/edy_silva/32/128302_2.png) [@Edy\_Silva](https://discuss.elastic.co/u/Edy_Silva)\
**Post date:** [June 11, 2024, 4:27pm UTC](https://discuss.elastic.co/t/is-there-any-tool-outside-that-allows-me-to-write-javascript-code-as-scripts/361281/1 "2024-06-11T16:27:47Z")

</div>

Painless is not quite painless. My team has been struggling with painless scripts due to a couple of reasons:

1. (as far as I know) it's not possible to execute scripts locally - it would be great to write unit tests;
2. painless misses some useful features like JSON parsing/stringifying.

Other ecosytem tools would be great like LSP.

Well, I started doing some experiments with ANTLR in order to come up with a tool that compiles JavaScript to Painless - using this we would get all the JS ecosystem like LSP and test runners.

I'd like to check with more experienced people if there's a tool like that already or even if there's a plan from Elastic team or something to add this ecosystem to painless itself.

Context: We've been using scripts as transformes in Watcher pipeline

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 9, 2024, 4:28pm UTC](https://discuss.elastic.co/t/is-there-any-tool-outside-that-allows-me-to-write-javascript-code-as-scripts/361281/2 "2024-07-09T16:28:37Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
