# Elm2node: transform an elm module to a synchronous node module

**URL:** <https://discourse.elm-lang.org/t/elm2node-transform-an-elm-module-to-a-synchronous-node-module/6246>\
**Category:** Show and Tell\
**Created:** [September 2, 2020, 1:01pm UTC](https://discourse.elm-lang.org/t/elm2node-transform-an-elm-module-to-a-synchronous-node-module/6246 "2020-09-02T13:01:58Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![dta](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/dta/32/1917_2.png) [@dta](https://discourse.elm-lang.org/u/dta)\
**Post date:** [September 5, 2020, 8:17pm UTC](https://discourse.elm-lang.org/t/elm2node-transform-an-elm-module-to-a-synchronous-node-module/6246/14 "2020-09-05T20:17:35Z")

</div>

It would not be possible for another piece of code to modify `arg` during the execution of `elmModule.f` since JavaScript is single-threaded. However, if elm code keeps a reference to the json `Value`, it _is_ possible for two decodings of the value to produce different results if some non-elm code runs in between.

In a normal elm program, this is a possibility (and is actually sometimes useful), but I don’t know enough about your code to know whether it is a possibility in your library. Does your library ever keep any state, or in other words does your library allow wrapping `Program` types? If not, then it should be safe.

---

_[View the full topic](https://discourse.elm-lang.org/t/elm2node-transform-an-elm-module-to-a-synchronous-node-module/6246)._
