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

Use modern exports in the next major version #320

Closed
EvanHahn opened this issue May 18, 2021 · 1 comment
Closed

Use modern exports in the next major version #320

EvanHahn opened this issue May 18, 2021 · 1 comment

Comments

@EvanHahn
Copy link
Member

The current version of Helmet uses module.exports to export everything. Ideally, the next major version could use ECMAScript modules.

Ideally, there's a solution that:

  • Allows import helmet from 'helmet' in JavaScript and TypeScript
  • Allows const helmet = require('helmet') in JavaScript (though require('helmet').default is acceptable)
  • Allows us to export additional things, like the oft-requested HelmetOptions type or each middleware
  • Works in Node 12+
  • Doesn't require major version bumps of middleware modules (though that is acceptable)

There may be other goals. I think this is achievable now that ES modules have stabilized in Node, but we'll need to do some testing.

@EvanHahn
Copy link
Member Author

EvanHahn commented Dec 5, 2021

Closed in #340.

@EvanHahn EvanHahn closed this as completed Dec 5, 2021
EvanHahn added a commit that referenced this issue Jan 2, 2022
See [#320][0] and [#340][1].

[0]: #320
[1]: #340
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant