xr-easy-json

easy json database for new coders

Usage no npm install needed!

<script type="module">
  import xrEasyJson from 'https://cdn.skypack.dev/xr-easy-json';
</script>

README

xr-easy-json

Example

const Data = require('xr-easy-json')
const db = new Data("./db.xr")

// Set data
db.set("hello.man", "Hello") // Hello

// Get data
db.get("hello.man") // Hello

// Fetch data
db.fetch("hello.man") // Hello

// Has data
db.has("hello.man") // true

// Delete data
db.delete("hello.man")

db.get("hello.man") // undefined
db.has("hello.man") // false

// Array data
db.set("list", [ "apple", "milk" ])
db.push("list", "bread") // ["apple", "milk", "bread"]

// Fetch all datas
db.all()

// Clear data
db.clear()