node-talib
node-talib copied to clipboard
Import with ES6?
Hi, I'd love to use your lib but using
import talib from 'talib';
I get the following error
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".node"
Any idea how to solve my issue?
For those interested, it's because I am creating a type="module" thus I can't use require, using the following
import { createRequire } from "module";
const require = createRequire(import.meta.url);
const talib = require('talib');
allowed me to use require But it's weird that this library can't be used using ES6 import. I'll leave this issue open in case the maintainer knows how to make it compatible