📞 Example

Getting Started

const isadb = require('isadb2')

async function main() { // Asynchronous function for example
    await isadb.create() // Creating isaDB instance

    await isadb.set('foo', 'bar') // Setting properties
    isadb.get('foo').then(value => {
        console.log(value) // Will return -> bar
    })
}

main()

Objects

const isadb2 = require('isadb2')

async function main() {
    await isadb2.create() // Creating isaDB instance

    await isadb2.set('object', {name: 'renato', surname: 'gouveia', age: 42, email: 'renato@email.com'}) // Saving an object
    console.log(await isadb2.get('object')) // Returns the complete object / using await
    console.log(await isadb2.get('object.surname')) // Returns only the 'surname' property / using await
    isadb2.get('object.name').then(value => {
        console.log(value) // Returns only the 'name' property / using then
    })
    isadb2.get('object.age').then(value => {
        console.log(value) // Returns only the 'age' property / using then
    })
}

main()

Example of .isadb2 File

$anyObject[Object({"name": "cool"})]
$anyNumber[Number(12)]
$anyArray[Array(name1, name2, name3, Number(12), Object({"product": "xilito"}))]
$anyString[cool]
# Any comment