Package Exports
- secure-db
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (secure-db) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
SecureDB - Local Database
SecureDB is a fast, encrypted, simple and easy to use database package for simple projects with local JSON storage.
Installation
This is a Node.js module available through the npm registry.
Before installing, download and install Node.js. Node.js 0.10 or higher is required.
Installation is done using the
npm install command:
$ npm install secure-dbconst { Database } = require('secure-db');
const db = new Database('my-database');
// ES6
import { Database } from 'secure-db';
const db = new Database('my-database');Features
- 1.3.0^
Safe Data
This package is 100% secure because it has a key encryption feature cript.js. The data is stored in JSON format so its handling becomes faster and more perfomatic. There is no need to run a server to use the database because its storage is saved locally.
Separate Databases
It is possible to create several databases separated by folders and files, all with individual security. All databases created can have a
Child Databasewhich is a space within a database separated by file and can be accessed individually.
Individual Security Keys
All saved data is initially stored with encryption. Each database has its security key that is used to encrypt the data, if it is changed, the saved data is lost forever or until the key is renconstructed correctly.
Disable Encryption
It is possible to disable the encryption of the databases
new Database('your-database', false). If you disable encryption, your data will lose security and it will be possible to change your data through the file itself.
Need Help? Check out:
- Documentation: SecureDB/docs
- Support: SecureDB/Discord
- OpenSource: SecureDB/OS
Example
const db = require('secure-db'); // + v1.3.2
// Saves data to the database
db.set('Felipe', { age: 30 }); // Felipe: { age: 30 }
// Pushing an element to an array
db.push('Felipe.books', 'Harry Potter'); // Felipe: { books: ['Harry Potter'] }
// Add in a number
db.sum('Felipe.age', 3); // Felipe: { age: 33 }
// Subtract a number
db.sub('Felipe.age', 2); // Felipe: { age: 31 }
// Returns saved data
db.get('Felipe'); // Felipe: { age: 31, books: ['Harry Potter'] }
db.get('Felipe.books'); // Felipe: { books: ['Harry Potter'] }