typicode / lowdb

Simple and fast JSON database
MIT License
21.35k stars 918 forks source link

Need "main" property in package.json #509

Closed benjamin-feron closed 2 years ago

benjamin-feron commented 2 years ago

There is no "main" directive in package.json so importation of this module doesn't work. If I add "main": "./lib/index.js" importation works.

typicode commented 2 years ago

Hi @benjamin-feron

Lowdb 3 is a pure ESM package, see https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c You can try to migrate your project to ESM.

Alternatively, you can also use lowdb 1 which is battle tested (still used in JSON Server) and can be required.

benjamin-feron commented 2 years ago

Thank you for your response. I think I will use lowdb 1