Closed NickKelly1 closed 2 years ago
Hi,
I'd recommend using v1 which is stable and used in JSON Server. When ready you can switch to v2.
@typicode isn't v3 stable now? I'm not sure if this is related to this issue but I got ESM error when I use it with babel-node in this way:
import { Low, JSONFile } from 'lowdb';
Error is:
Error [ERR_REQUIRE_ESM]: require() of ES Module node_modules/lowdb/lib/index.js from index.js not supported.
Instead change the require of node_modules/lowdb/lib/index.js in index.js to a dynamic import() which is available in all CommonJS modules.
Note that tt's working well when bundled with webpack.
I'm not really familiar with all these import/require specifications. If you have any idea that can help me finding a solution. Otherwise I'm happy doing a bit of research to figure out
@gsouf This might be helpful to you: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
@luukdv thanks, but there are just way too many incompatibilities when we use this for an app that we bundle for the web, and this is a real pain to fix. I ended bundling the sources using esbuild with --platform=node
.
Hi,
How do I install this package without ESM? Is there a non-ESM version?