yamlsonbase
v1.0.1
Published
a DB that can store folders and files. despite this the code is short with over 100 lines.
Readme
how to use this DB thingy.
require the package (duh.)
const FileDatabase = require('file-database');now create the instance
const db = new FileDatabase('./myDatabase');'kay now it is time to get to the basics here.
Folder Operations
db.createFolder('folderName');to read the folder
const files = db.readFolder('folderName'); // Returns an array of file names in the folderdeleteing a folder
db.deleteFolder('folderName');File operations (JSON or YAML)
Here are the files.
JSON
Create:
db.createJSON('fileName', { key: 'value' }, 'folderName');Read:
const data = db.readJSON('fileName', 'folderName'); // Returns the parsed JSON dataDelete:
db.deleteJSON('fileName', 'folderName');YAML
Create:
db.createYAML('fileName', { key: 'value' }, 'folderName');Read:
const data = db.readYAML('fileName', 'folderName'); // Returns the parsed YAML dataDelete:
db.deleteYAML('fileName', 'folderName');End
It ends here. yeah uhh hope you have fun with it i guess..
