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

Want to use with NestJS #598

Open
Neos21 opened this issue Sep 23, 2024 · 1 comment
Open

Want to use with NestJS #598

Neos21 opened this issue Sep 23, 2024 · 1 comment

Comments

@Neos21
Copy link

Neos21 commented Sep 23, 2024

I want to use lowdb with NestJS.
But lowdb is ESM, and NestJS is CommonJS.
How to configure this?

@tajnymag
Copy link

tajnymag commented Sep 23, 2024

According to many Nestjs discussions, the recommended way is to use Node v22+ and run your app with --experimental-require-module until it gets ported to stable Nodejs release.

Alternatively, if you don't need to access lowdb in constructor, import it with a dynamic import at the place you need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants