# How store JSONata expression inside a global variable and use that for evaluation

**URL:** <https://discourse.nodered.org/t/how-store-jsonata-expression-inside-a-global-variable-and-use-that-for-evaluation/9032>\
**Category:** General\
**Created:** [15 March 2019 18:34 UTC](https://discourse.nodered.org/t/how-store-jsonata-expression-inside-a-global-variable-and-use-that-for-evaluation/9032 "2019-03-15T18:34:29Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![shrickus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shrickus/32/517_2.png) [@shrickus](https://discourse.nodered.org/u/shrickus)\
**Post date:** [15 March 2019 19:01 UTC](https://discourse.nodered.org/t/how-store-jsonata-expression-inside-a-global-variable-and-use-that-for-evaluation/9032/2 "2019-03-15T19:01:10Z")

</div>

I think the only way is to npm install the `jsonata` library into your project, `require` it in your settings.js file, and call it from inside your function code.

Andre shows the process (for another lib) at the start of [this discussion](https://discourse.nodered.org/t/flow-to-decode-binary-data-and-a-walk-through-on-how-to-install-the-npm-module/5174) -- good luck!

---

_[View the full topic](https://discourse.nodered.org/t/how-store-jsonata-expression-inside-a-global-variable-and-use-that-for-evaluation/9032)._
