yamlsonbase
v1.0.1
Published
a DB that can store folders and files. despite this the code is short with over 100 lines.
Downloads
152
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 folder
deleteing 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 data
Delete:
db.deleteJSON('fileName', 'folderName');
YAML
Create:
db.createYAML('fileName', { key: 'value' }, 'folderName');
Read:
const data = db.readYAML('fileName', 'folderName'); // Returns the parsed YAML data
Delete:
db.deleteYAML('fileName', 'folderName');
End
It ends here. yeah uhh hope you have fun with it i guess..