[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to import express and have typing? #15955

Closed
MatthD opened this issue Sep 19, 2022 · 3 comments
Closed

How to import express and have typing? #15955

MatthD opened this issue Sep 19, 2022 · 3 comments
Labels
feat new feature (which has been agreed to/accepted) node compat

Comments

@MatthD
Copy link
MatthD commented Sep 19, 2022

Hello,

Just following the documentation I tried to

/// <reference path="https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/types/express/index.d.ts" />
import express from "npm:express";

const app = express();

but no luck, app is of any types,

More generally I do not understand how to deal with types coming from npm modules.

@kitsonk kitsonk added feat new feature (which has been agreed to/accepted) node compat labels Sep 19, 2022
@kitsonk
Copy link
Contributor
kitsonk commented Sep 19, 2022

This is not currently supported with experimental npm specifiers, but is on the roadmap.

@kitsonk
Copy link
Contributor
kitsonk commented Sep 19, 2022

#15960 has been opened to track progress of support. Closing in favour of that.

@kitsonk kitsonk closed this as not planned Won't fix, can't repro, duplicate, stale Sep 19, 2022
@loynoir
Copy link
loynoir commented Oct 1, 2022

Not tested, but you may try https://esm.sh/{{package}}@{{version}}.

Plus, you can get https://esm.sh self hosted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat new feature (which has been agreed to/accepted) node compat
Projects
None yet
Development

No branches or pull requests

3 participants