Giter Club home page Giter Club logo

Comments (3)

yvele avatar yvele commented on June 16, 2024 6

Same problem and I find out https://github.com/remusao/tldts which is better, faster works everywhere and has better semantic (PS: I'm not related to tldts but it's way so better I have to mention it here).

from parse-domain.

jhnns avatar jhnns commented on June 16, 2024 1

I'm sorry, we switched to ECMAScript modules only. I recommend to also migrate to ESM as this problem will come up everytime a new dependency version switches to ESM.

You should also be able to import ECMAScript modules asynchronously into CommonJS though:

import("parse-domain").then(({parseDomain}) => {
  // This gets executed once the module is loaded
  // You can call parseDomain() now
}):

I think that it would be possible to make 2 versions - ESM and CJS, but no...

Yes, it is possible, but very error prone. A lot of module authors get it wrong to configure it properly and I don't have the time to support two module systems. You're welcome to fork the module and create a CommonJS build.

from parse-domain.

aaaee2 avatar aaaee2 commented on June 16, 2024

We use the NestJS framework and don't have ESM related options at all.
The only way to use the parse-domain module in TypeScript is to use a version no older than 5.x.x. It WAS a good module, but the author(s) don't seem to care about its fate. I think that it would be possible to make 2 versions - ESM and CJS, but no...

from parse-domain.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.