1.1.2 • Published 5 years ago
db.txt v1.1.2
Text Database
A persistent database run by a single .txt file.
API Documentation: Here.
PlainTextQuery
A PlainTextQuery is:
<Key>:<Value>
How do I start using it?
Its quite easy!
const TextDb = require('db.txt');
let myDb = new TextDb(); // or let myDb = new TextDb({ name: "file name" }). -> Database { ... }
// Set, <Database>.set(key, value)
// You can also set objects, booleans, strings. We support them. (soon xd)
myDb.set('Yeet', true).then(data => {
data.save(); // Saves it to the text file. (Editing the file might cause issues!)
});
// Get, <Database>.get(key)
myDb.get('Yeet').then(data => {
console.log(data.out); // -> true
});
// setQuery, <Database>.setQuery(keyVal)
myDb.setQuery('Yeet:true').then(data => {
data.save();
});
1.1.2
5 years ago
1.1.1
5 years ago
1.0.4
5 years ago
1.0.3
5 years ago
1.0.2-beta
5 years ago
1.0.1-beta
5 years ago
1.0.0
5 years ago