read & write dwebx.json files. Uses toiletdb under the hood.
npm install dwebx-json
var DWebxJSON = require('dwebx-json')
var dwebxjson = DWebxJSON(archive)
dwebxjson.create({title: 'a dwebx', description: 'exciting'}, function (err) {
if (err) throw err
})
dwebxjson.read(function (err, data) {
console.log(data)
})Write to a dwebx.json on the file system also:
var DWebxJSON = require('dwebx-json')
var dwebxjson = DWebxJSON(archive, {file: path.join(dwebx.path, 'dwebx.json')})
dwebxjson.create({title: 'a dwebx', description: 'exciting'}, function (err) {
if (err) throw err
})TODO: replace file option with ddrive indexing
create a new dwebxJson db
Options:
opts.file- dwebx.json file path, updates will be written to file system and archive
Create a new dwebx.json file in the archive with the default keys (url, title, description). Pass in any additional data to add on initial create.
Write a single key and value or an object, data, to the dwebx.json file. Use file option above to also update the file on the file system.
Delete a key from the dwebx.json file.
Read the current dwebx.json.