Skip to content
Documentation
JSON Adapter

JSON Adapter

The JSON Adapter in verse.db allows seamless interaction with your data stored in JSON files. Here's how you can set it up and use it:

Setting Up the Database:

  • First, establish a connection to your database using the versedb.connect function.

  • Specify the adapter as "json" and provide the path to the directory containing your JSON files using the dataPath parameter.

  • Optionally, enable development logs (devLogs) and encryption (not recommended for now) using the respective settings.

  • Example configuration:

    const versedb = require("verse.db");
    const db = versedb.connect({
      adapter: "json",
      dataPath: "./data", // Path to your JSON files
      devLogs: {
        enable: true,
        path: "./logs",
      },
      encryption: {
        enable: false,
        secret: "", // Your secret passphrase (optional)
      }
    });

Feel free to explore the power of the JSON Adapter in verse.db for efficient data management! 📂✨

Functions:


VERSE.DB. Powered by JEDI Studio.