cinar / indicatorts

IndicatorTS - Stock technical indicators and strategies in TypeScript for browser and server programs.
MIT License
283 stars 48 forks source link

Error importing roc #436

Open gabrieldodan opened 6 months ago

gabrieldodan commented 6 months ago

Hi,

I am getting this error when I try to use the roc function/indicator. No problem with other indicators, RSI for example. Any idea? Thanks!

import {roc} from 'indicatorts';
        ^^^
SyntaxError: Named export 'roc' not found. The requested module 'indicatorts' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from 'indicatorts';
const {roc} = pkg;

    at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)

Node.js v18.17.1