anandanand84 / technicalindicators

A javascript technical indicators written in typescript with pattern recognition right in the browser
MIT License
2.18k stars 563 forks source link

[FYI] Node.js and indicators #49

Closed vlad-saling closed 7 years ago

vlad-saling commented 7 years ago

Hi,

thank you for this module! It saves quite a lot of time and coding. While implementing it inside an Node.js app I've noticed that this const SMA = require('technicalindicators').SMA isn't working. Upon calling SMA it throws "undefined". I looked a bit into the code and it works if I do this: const SMA = require('technicalindicators').window.SMA

Not sure if you want/need to update your docs, but I've figured somebody might find this useful when searching issues.

Feel free to close this issue right away or let me know if I am doing something wrong.

anandanand84 commented 7 years ago

you're right. Currently there is an issue, i need to figure out a way to compile for both nodejs and browser

anandanand84 commented 7 years ago

Added better support for nodejs. This is fixed in version 1.0.5. Thanks for pointing out. Please verify

vlad-saling commented 7 years ago

Thank you for resolving this so quickly 👍. I've tested latest release and it is now working according docs.

You can close this issue.