defunctzombie / node-url

node.js core url module as a module
MIT License
375 stars 96 forks source link

How can I import this tool in typescript project? #54

Closed walkstreet closed 3 years ago

walkstreet commented 3 years ago

Help, I've got a question with the subject. I tried to use import * as url from "url", but it didn't work.

ljharb commented 3 years ago

It should be import url from 'url'. However, do note that TS's module system is broken unless you're using esModuleInterop and synthetic imports.