# Load EcmaScript module

**URL:** <https://discourse.nodered.org/t/load-ecmascript-module/33559>\
**Category:** General\
**Created:** [30 September 2020 10:18 UTC](https://discourse.nodered.org/t/load-ecmascript-module/33559 "2020-09-30T10:18:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![d0d04m3](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/d0d04m3/32/19965_2.png) [@d0d04m3](https://discourse.nodered.org/u/d0d04m3)\
**Post date:** [30 September 2020 10:18 UTC](https://discourse.nodered.org/t/load-ecmascript-module/33559/1 "2020-09-30T10:18:14Z")

</div>

hi i have some probleme when add EcmaScript module to node-red

> **[bitwise](https://www.npmjs.com/package/bitwise)**
>
> Manipulates bits, nibbles, bytes, and buffers.

  
this module use import not require  
so how add it to **functionGlobalContext** in settings.js  
same CommonJS method or other way to add it!

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [30 September 2020 14:59 UTC](https://discourse.nodered.org/t/load-ecmascript-module/33559/2 "2020-09-30T14:59:54Z")

</div>

In Node.js, import works differently to import in the browser. You will need to read up on that difference.

Most JS modules written with import are assuming that you will have a build step that "compiles" the code. Possibly the simplest thing to do would be to raise an issue against the module and ask the author how to use it with node.js (or whether it is possible).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [29 November 2020 14:59 UTC](https://discourse.nodered.org/t/load-ecmascript-module/33559/3 "2020-11-29T14:59:59Z")

</div>

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