killua-db
v1.0.0
Published
Сверх маленькая и простенькая база данных, с легким функицоналом. Маловестная база данных.
Downloads
3
Readme
haku-db
простая и в тоже время легкая базаданных
Функции
add : добавлена возможность сохранения данных в базе данных
getAll(): добавлена возможность получения данных из базы данных
hasis(): добавлена возможность поиска данных в базе данных
remove(): добавлена возможность удаления данных из базы данных
save(): Добавлена возможность самому выбрать когда и что сохранить
load(): Добавлена возможность выгрузить данные из файла
update(): Добавлена возможность обновить данные.
Обновления
- Код переписан и теперь вместо просто файла идет сначала создания папки, а вторым аргументом файл
- пример
const TinyDB = require('./pkg/tinydb.js');
const db = new TinyDB('myDB', 'pipiska.json')
// вы можете дать любое названия ваще пофиг.
Установка
npm i haku-db
Примеры использования
const TinyDB = require('TinyDB');
const db = new TinyDB('db', 'mydb.json');
// загружаем данные из файла
db.load();
// добавляем новые данные
db.add({ username: 'Alice', message: 'Привет, мир!' });
db.add({ username: 'Bob', message: 'Как дела?' });
/* удаления
db.remove();
*/
// обновления
db.update(1, { name: "pon" });
// получаем все данные
const allData = db.getAll();
console.log(allData);
// сохраняем данные в файл
db.save();