Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including jebase with all npm packages installed. Try it out:

const jb = require('jebase') const db = new jb.Jebase('data.json', { default: 'values' }) = 'world' db.write()

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

jebase v2.0.0

An easy way to store settings or small databases in Node.js

Jebase - An easy way to store settings or small databases

Build Status npm npm license

First things - first

npm i jebase


const { Jebase } = require('jebase')
const db = new Jebase("somewhweretostore.json", {
    accounts: [],
    something: true

What does this code do?

  1. Includes Jebase
  2. Loads the database from somewheretostore.json, or if the file does not exist, creates it with these contents:
    "accounts": [],
    "something": true
  1. Done!

Interacting with data

When you load a database, it is stored inside object, so you can manipulate it, like it’s a regular JavaScript object."")
if ( {
        console.log("Something is enabled")

If you have changed something in the database and want to save it, just call db.write();!


new Jebase(file, defaults)

Returns db

Loads a database file

  • file - relative or absolute path to JSON file
  • defaults - what to write to the database if the file does not exist

Returns object DB contents


Returns void Writes JSON data to disk


RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free