A high-performance, secure, and robust local database
Velocedb is a lightweight, fast, and user-friendly local database designed for Node.js and TypeScript applications. It simplifies data management and persistence by storing data in a human-readable JSON format on your local file system.
- Open Source: Velocedb is open source, which means you have the freedom to modify it according to your preferences.
- Easy to Use: Velocedb offers a straightforward API for managing data.
- Customization: Easily configure database settings, such as encoding and JSON formatting, to fit your requirements.
- Security: Velocedb prioritizes data security to safeguard your information during access and storage.
- Lightweight: Velocedb is a lightweight and lightning-fast database. It has been optimized to deliver maximum speed and efficiency.
You can install Velocedb via NPM:
npm install velocedb
const Veloce = require('velocedb');
// Creating a new database located in the databases folder and called database.json.
const database = new Veloce('databases/database.json');
// Set your data.
database.data = {
string: 'string',
boolean: true
};
// Modify your data.
database.data.boolean = false;
// Save your data in the database.json file.
database.save();
// Delete your database.json file.
database.delete();
// Retrieve and check your data.
console.log(database.data);
You can customize the database by providing an options object when creating it. Here are the available configuration options:
- encoding: The encoding option is used for reading or writing the database file (default: 'utf-8').
- space: The number of spaces for JSON formatting (default: 2).
const Veloce = require('velocedb');
// Creating a database with custom configuration.
const database = new Veloce('database.json', {
space: 4
});