typicode / lowdb

Simple and fast JSON database
MIT License
21.49k stars 923 forks source link

Issues importing package #502

Closed bitsandtea closed 3 years ago

bitsandtea commented 3 years ago

Hello,

I am having issues importing the package in my project:

      import { LowSync, JSONFileSync } from 'lowdb';
      ^^^^^^

SyntaxError: Cannot use import statement outside a module
    at wrapSafe (internal/modules/cjs/loader.js:979:16)

Using require doesn't work neither. Any ideas?

JoCat commented 3 years ago

Should help solve your problem: https://stackoverflow.com/questions/31354559/using-node-js-require-vs-es6-import-export

bitsandtea commented 3 years ago

I just went with a package named simple-json-db it was so easy to set up, may help others who are struggling

paulmand3l commented 3 years ago

@bitsandtea perfect, thanks!