Installations
npm install elegantdb
Developer Guide
Typescript
Yes
Module System
CommonJS, ESM
Min. Node Version
>=16.0.0
Node Version
20.5.1
NPM Version
9.8.0
Releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (50.36%)
TypeScript (49.64%)
Developer
Nicat-dcw
Download Statistics
Total Downloads
1,039
Last Day
3
Last Week
3
Last Month
8
Last Year
317
GitHub Statistics
2 Stars
57 Commits
1 Watching
4 Branches
2 Contributors
Package Meta Information
Latest Version
2.0.2
Package Id
elegantdb@2.0.2
Unpacked Size
45.36 kB
Size
8.57 kB
File Count
22
NPM Version
9.8.0
Node Version
20.5.1
Publised On
23 Aug 2023
Total Downloads
Cumulative downloads
Total Downloads
1,039
Last day
0%
3
Compared to previous day
Last week
50%
3
Compared to previous week
Last month
-61.9%
8
Compared to previous month
Last year
-56.1%
317
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
4
Dev Dependencies
3
Elegant Database
Elegant Database is a JavaScript library that provides advanced features for managing and interacting with a database. It supports both JSON and Elegant (Custom Adaptor of ElegantDB) adaptors for storage.
Installation
You can install Elegant Database using npm:
1npm install elegantdb
Usage
Import the necessary components from the library:
1import { Database, JSONAdaptor, ElegantAdaptor } from 'elegantdb';
Create an instance of the Database
class with appropriate options:
1const db = new Database({ 2 adaptor: new JSONAdaptor(), // or new ElegantAdaptor() 3 path: './my-database.json', // Optional, specify the path 4 disableCheckUpdates: false, // Optional, disable update checks 5 useExperimentalCaches: false // Optional 6});
Database Adaptors
JSONAdaptor
: JSON adaptor | database.jsonElegantAdaptor
: Custom Adaptor of ElegantDB | database.elegant
Methods
set(key, value)
: Set a value in the database.add(key, value)
: Add a value in the database.get(key)
: Get a value from the database.has(key)
: Check if a key exists in the database.remove(key)
: Remove a key from the database.clone()
: Create a clone of the database instance.all()
: Get All Data from Adaptor.getCache()
: Get All Cache from Database
Contributing
If you encounter any issues or have suggestions for improvements, please feel free to open an issue on GitHub.
Versioning
We use Semantic Versioning for versioning. See the latest releases on npm.
License
This project is licensed under the ISC License.
Please feel free to copy and paste this template into your repository's README file. Make sure to review it and adjust any formatting or content as needed to fit your preferences.
No vulnerabilities found.
No security vulnerabilities found.