Skip to content

lowdb doesn't create database #597

Description

@uniboxx

Hi, here my code:

import { JSONFilePreset } from 'lowdb/node';

const defaultData = { posts: [] };
const db = await JSONFilePreset('db.json', defaultData);

If I run the server with this code the db.json doesn't be created.
It will if I add this line.

db.write();

As I see in the instructions it should work without the last line. Any suggestion?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions