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

Why do you use this import syntax in TypeScript? #41

Closed
fairydhwen opened this issue Apr 13, 2017 · 1 comment
Closed

Why do you use this import syntax in TypeScript? #41

fairydhwen opened this issue Apr 13, 2017 · 1 comment
Labels

Comments

@fairydhwen
Copy link

Why do you use :
import * as bodyParser from 'body-parser'; and not import { * } from './....'; syntax ?
Also i dont understand why no export class ?

It looks like it's just a JS to TS transpilation.

@MarkPieszak
Copy link

When you're doing something like that it's because it's a commonJS module, and isn't export'ing things itself, so you need to just pull down the whole thing.

It's the TS equivalent of var bodyParser = require('body-parser');

@DavideViolante DavideViolante changed the title NodeJS and TypeScript Why do you use this import syntax in TypeScript? Apr 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants