axiodb 9.5.0 → 9.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -132,7 +132,7 @@ docker run -d \
|
|
|
132
132
|
|
|
133
133
|
```javascript
|
|
134
134
|
const { AxioDB } = require('axiodb');
|
|
135
|
-
const db = new AxioDB(false, 'MyDB', '.', true); // Enable TCP on port 27019
|
|
135
|
+
const db = new AxioDB({ GUI: false, RootName: 'MyDB', CustomPath: '.', TCP: true }); // Enable TCP on port 27019
|
|
136
136
|
```
|
|
137
137
|
|
|
138
138
|
### Quick Start - Client
|
|
@@ -235,10 +235,10 @@ AxioDB includes a built-in web-based GUI for database visualization and manageme
|
|
|
235
235
|
|
|
236
236
|
```javascript
|
|
237
237
|
// Enable GUI when creating AxioDB instance
|
|
238
|
-
const db = new AxioDB(true); // GUI available at localhost:27018
|
|
238
|
+
const db = new AxioDB({ GUI: true }); // GUI available at localhost:27018
|
|
239
239
|
|
|
240
240
|
// With custom database path
|
|
241
|
-
const db = new AxioDB(true, "MyDB", "./custom/path");
|
|
241
|
+
const db = new AxioDB({ GUI: true, RootName: "MyDB", CustomPath: "./custom/path" });
|
|
242
242
|
```
|
|
243
243
|
|
|
244
244
|
### GUI Features
|
|
@@ -302,7 +302,7 @@ npm install axiodb@latest --save
|
|
|
302
302
|
const { AxioDB } = require('axiodb');
|
|
303
303
|
|
|
304
304
|
// Create AxioDB instance with built-in GUI
|
|
305
|
-
const db = new AxioDB(true); // Enable GUI at localhost:27018
|
|
305
|
+
const db = new AxioDB({ GUI: true }); // Enable GUI at localhost:27018
|
|
306
306
|
|
|
307
307
|
// Create database and collection
|
|
308
308
|
const myDB = await db.createDB('HelloWorldDB');
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import Database from "./Database/database.operation";
|
|
2
2
|
import { ErrorInterface, SuccessInterface } from "../config/Interfaces/Helper/response.helper.interface";
|
|
3
|
+
import { AxioDBOptions } from "../config/Interfaces/Operation/Indexation.operation.interface";
|
|
3
4
|
/**
|
|
4
5
|
* Class representing the AxioDB database.
|
|
5
|
-
* @param {
|
|
6
|
+
* @param {AxioDBOptions} options - Configuration options for AxioDB
|
|
7
|
+
* @param {boolean} options.GUI - Enable/disable HTTP GUI server (port 27018). Defaults to false.
|
|
8
|
+
* @param {string} options.RootName - Custom name for the database root folder. Defaults to "AxioDB".
|
|
9
|
+
* @param {string} options.CustomPath - Custom path for database storage. Defaults to current directory.
|
|
10
|
+
* @param {boolean} options.TCP - Enable/disable TCP server (port 27019). Defaults to false.
|
|
6
11
|
* @returns {AxioDB} - Returns the instance of AxioDB.
|
|
12
|
+
* @example
|
|
13
|
+
* const db = new AxioDB({ GUI: true, RootName: "MyDB", CustomPath: "./data" });
|
|
7
14
|
*/
|
|
8
15
|
export declare class AxioDB {
|
|
9
16
|
private readonly RootName;
|
|
@@ -16,7 +23,7 @@ export declare class AxioDB {
|
|
|
16
23
|
private DatabaseMap;
|
|
17
24
|
private GUI;
|
|
18
25
|
private TCP;
|
|
19
|
-
constructor(
|
|
26
|
+
constructor(options?: AxioDBOptions);
|
|
20
27
|
/**
|
|
21
28
|
* Initializes the root directory for the AxioDB.
|
|
22
29
|
*
|
|
@@ -29,17 +29,25 @@ const server_1 = __importDefault(require("../server/config/server"));
|
|
|
29
29
|
const server_2 = __importDefault(require("../tcp/config/server"));
|
|
30
30
|
/**
|
|
31
31
|
* Class representing the AxioDB database.
|
|
32
|
-
* @param {
|
|
32
|
+
* @param {AxioDBOptions} options - Configuration options for AxioDB
|
|
33
|
+
* @param {boolean} options.GUI - Enable/disable HTTP GUI server (port 27018). Defaults to false.
|
|
34
|
+
* @param {string} options.RootName - Custom name for the database root folder. Defaults to "AxioDB".
|
|
35
|
+
* @param {string} options.CustomPath - Custom path for database storage. Defaults to current directory.
|
|
36
|
+
* @param {boolean} options.TCP - Enable/disable TCP server (port 27019). Defaults to false.
|
|
33
37
|
* @returns {AxioDB} - Returns the instance of AxioDB.
|
|
38
|
+
* @example
|
|
39
|
+
* const db = new AxioDB({ GUI: true, RootName: "MyDB", CustomPath: "./data" });
|
|
34
40
|
*/
|
|
35
41
|
class AxioDB {
|
|
36
|
-
constructor(
|
|
42
|
+
constructor(options = {}) {
|
|
37
43
|
this.GUI = Keys_1.General.DBMS_GUI_Enable;
|
|
38
44
|
this.TCP = false;
|
|
39
45
|
if (AxioDB._instance) {
|
|
40
46
|
throw new Error("Only one instance of AxioDB is allowed.");
|
|
41
47
|
}
|
|
42
48
|
AxioDB._instance = this;
|
|
49
|
+
const { GUI, RootName, CustomPath, TCP } = options;
|
|
50
|
+
// Default Vlaues
|
|
43
51
|
this.RootName = RootName || Keys_1.General.DBMS_Name; // Set the root name
|
|
44
52
|
this.currentPATH = path_1.default.resolve(CustomPath || "."); // Set the current path
|
|
45
53
|
this.fileManager = new FileManager_1.default(); // Initialize the FileManager class
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Indexation.operation.js","sourceRoot":"","sources":["../../source/Services/Indexation.operation.ts"],"names":[],"mappings":";AAAA,uDAAuD;;;;;;;;;;;;;;;AAEvD,mBAAmB;AACnB,mFAA2D;AAC3D,uFAA+D;AAC/D,8CAA8C;AAC9C,gDAAwB;AACxB,uFAAqD;AACrD,kDAAkD;AAElD,iBAAiB;AACjB,kFAAmD;AACnD,mCAA8C;AAC9C,gFAAuD;AAQvD,qEAAgE;AAEhE,kEAAyD;AAEzD
|
|
1
|
+
{"version":3,"file":"Indexation.operation.js","sourceRoot":"","sources":["../../source/Services/Indexation.operation.ts"],"names":[],"mappings":";AAAA,uDAAuD;;;;;;;;;;;;;;;AAEvD,mBAAmB;AACnB,mFAA2D;AAC3D,uFAA+D;AAC/D,8CAA8C;AAC9C,gDAAwB;AACxB,uFAAqD;AACrD,kDAAkD;AAElD,iBAAiB;AACjB,kFAAmD;AACnD,mCAA8C;AAC9C,gFAAuD;AAQvD,qEAAgE;AAEhE,kEAAyD;AAEzD;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,CAChC,aAAa,MAAM,uBAAuB,CAC3C,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,aAAa,MAAM,iBAAiB,CAAC,CAAC;YACzE,CAAC;QACH,CAAC;KAAA;CACF;AAhMD,wBAgMC"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { DatabaseMap } from "./database.operation.interface";
|
|
2
|
+
export interface AxioDBOptions {
|
|
3
|
+
GUI?: boolean;
|
|
4
|
+
RootName?: string;
|
|
5
|
+
CustomPath?: string;
|
|
6
|
+
TCP?: boolean;
|
|
7
|
+
}
|
|
2
8
|
export interface FinalDatabaseInfo {
|
|
3
9
|
CurrentPath: string;
|
|
4
10
|
RootName: string;
|
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "axiodb",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.6.1",
|
|
4
4
|
"description": "The Pure JavaScript Alternative to SQLite. Embedded NoSQL database for Node.js with MongoDB-style queries, zero native dependencies, built-in InMemoryCache, and web GUI. Perfect for desktop apps, CLI tools, and embedded systems. No compilation, no platform issues—pure JavaScript from npm install to production.",
|
|
5
5
|
"main": "./lib/config/DB.js",
|
|
6
6
|
"types": "./lib/config/DB.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"test": "node ./Test/run.js",
|
|
9
|
-
"build": "tsc"
|
|
10
|
-
"lint": "eslint ."
|
|
9
|
+
"build": "tsc"
|
|
11
10
|
},
|
|
12
11
|
"keywords": [
|
|
13
12
|
"axiodb",
|
|
@@ -62,18 +61,13 @@
|
|
|
62
61
|
"@fastify/cors": "^11.0.1",
|
|
63
62
|
"@fastify/multipart": "^9.0.3",
|
|
64
63
|
"@fastify/static": "^8.2.0",
|
|
65
|
-
"@types/tar": "^6.1.13",
|
|
66
64
|
"fastify": "^5.4.0",
|
|
67
65
|
"outers": "^8.6.2",
|
|
68
66
|
"tar": "^7.4.3"
|
|
69
67
|
},
|
|
70
68
|
"devDependencies": {
|
|
71
|
-
"@
|
|
72
|
-
"
|
|
73
|
-
"eslint": "^8.57.1",
|
|
74
|
-
"globals": "^15.9.0",
|
|
75
|
-
"typescript": "^5.6.2",
|
|
76
|
-
"typescript-eslint": "^8.8.0"
|
|
69
|
+
"@types/tar": "^6.1.13",
|
|
70
|
+
"typescript": "^5.6.2"
|
|
77
71
|
},
|
|
78
72
|
"engines": {
|
|
79
73
|
"node": ">=20.0.0",
|