# \[Feature Request\]Allow one-liner JavaScript as well as JSONata

**URL:** <https://discourse.nodered.org/t/feature-request-allow-one-liner-javascript-as-well-as-jsonata/82825>\
**Category:** Feature Requests\
**Created:** [13 November 2023 11:47 UTC](https://discourse.nodered.org/t/feature-request-allow-one-liner-javascript-as-well-as-jsonata/82825 "2023-11-13T11:47:51Z")\
**Posts on this page:** 1\
**Showing post:** 43

<div class="post-metadata">

**Author:** ![ralphwetzel](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ralphwetzel/32/53713_2.png) [@ralphwetzel](https://discourse.nodered.org/u/ralphwetzel)\
**Post date:** [15 November 2023 08:41 UTC](https://discourse.nodered.org/t/feature-request-allow-one-liner-javascript-as-well-as-jsonata/82825/43 "2023-11-15T08:41:28Z")

</div>

> [@kuema](#):
>
> You couldn't imagine the (evil) things they created with it...

That's human creativity in action! 😁

Leaving off any bias, this leads to the story of the knifes. People have to learn which end hurts - either by being teached (not just told!) or by personal experience. Yet as we all know, despite this latent danger, we're still using knives - and are occasionally extremely proud when they are laser sharp.

Additionally - e.g. if you're in a production environment - there's always the option to switch off this feature. Alternatively, it might be an idea to `opt in` this functionality - as it's already the case with a number of others.

> [@kuema](#):
>
> Simply allowing for complex expressions in a single field of a `change` node kind of defeats the benefits of Node-RED as a **visual** programming tool.

Agreed. Still it might be an efficient way to do things - and it's [already done](https://discourse.nodered.org/t/can-any-one-help-with-a-more-elegant-way-of-me-extracting-the-data-i-need-from-a-json-string/82335/11):

> [@Can any one help with a more elegant way of me extracting the data I need from a JSON string](https://discourse.nodered.org/t/can-any-one-help-with-a-more-elegant-way-of-me-extracting-the-data-i-need-from-a-json-string/82335/11):
>
> I prefer to use this JSONata expression:
> 
> ```auto
> payload {
> cid: $ ~> | $ | 
> data {
> "timestamp": $fromMillis($number($keys($)[0])),
> "data": *
> }
> |
> }
> 
> ```
> 
> (although most "normal" people would opt for plain JS ;\*)

BTW, this shows up in the editor as

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/3/d3172ced0bf29b3e87f5509201bd5872f0431fe3.png)

🤔

---

_[View the full topic](https://discourse.nodered.org/t/feature-request-allow-one-liner-javascript-as-well-as-jsonata/82825)._
