bithavoc / express-winston

express.js middleware for winstonjs
https://www.npmjs.com/package/express-winston
MIT License
798 stars 186 forks source link

TypeScript compilation fails. Cannot find module express-winston #123

Open ValeriyDP opened 7 years ago

ValeriyDP commented 7 years ago
server/lib/logger.ts(3,33): error TS2307: Cannot find module 'express-winston'.

Solved with const expressWinston = require('express-winston');

But I believe that this has to be added to http://definitelytyped.org/

Thanks

rosston commented 7 years ago

Took me a little bit, but I think I get it. Are you saying that you expect to be able to do

import expressWinston from 'express-winston';

and instead have to do

const expressWinston = require('express-winston');

?

I'm open to a PR for a .d.ts file in this project (looks like you can do it in project, as here: http://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html). Or anyone could do it on http://definitelytyped.org.

This is something I might end up getting to myself, but it won't be my highest priority, considering that it does work with a require (and the usage for this module is so limited that the lack of types won't much influence the rest of your application).

lomby92 commented 6 years ago

I'm using TypeScript and my app works with:

import * as expressWinston from 'express-winston'