1.0.1 • Published 11 months ago

yamlsonbase v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
11 months ago

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..

1.0.1

11 months ago

1.0.0

11 months ago