article-extractor icon indicating copy to clipboard operation
article-extractor copied to clipboard

Is it possible to enable the Require() Import ?

Open Philrobots opened this issue 1 month ago • 4 comments

Hello,

I have a typescript application and I use your tool. In my Typescript file, I import your library dynamically with the

import { extract } from “@extractus/article-extractor”;

But once the code compiles in Javascript, it converts to

const article_extractor_1 = require(“@extractus/article-extractor”);

And I get an error :

const article_extractor_1 = require("@extractus/article-extractor");

Error [ERR_REQUIRE_ESM]: require() of ES Module 

** to a dynamic import() which is available in all CommonJS modules.

Is it possible to make the import available with require like the old article-parser library?

Thanks

Philrobots avatar May 09 '24 19:05 Philrobots