beanbagdb 0.5.52 → 0.5.54
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/doc-src/3_plugins.md +23 -1
- package/package.json +3 -2
- package/src/index.js +284 -265
- package/src/plugins/text_command.js +193 -0
- package/src/system_schema.js +34 -4
- package/test/couchdb.js +2 -2
- package/test/operations.test.js +1687 -286
- package/test/plugin.test.js +55 -0
- package/test/pouchdb.js +12 -6
- package/test/test1.js +146 -161
package/doc-src/3_plugins.md
CHANGED
|
@@ -1 +1,23 @@
|
|
|
1
|
-
# How to use plugins
|
|
1
|
+
# How to use plugins
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
// MyPlugin.js
|
|
5
|
+
const MyPlugin = {
|
|
6
|
+
// This function will be bound to the class instance (passed as 'thisArg')
|
|
7
|
+
on_load: async function(instance) {
|
|
8
|
+
console.log("Plugin loaded with instance:", instance);
|
|
9
|
+
// You can access instance properties and methods here
|
|
10
|
+
instance.someMethod();
|
|
11
|
+
},
|
|
12
|
+
|
|
13
|
+
// Another plugin function
|
|
14
|
+
doSomething: function(instance, arg) {
|
|
15
|
+
console.log("Plugin doing something with arg:", arg);
|
|
16
|
+
// Access the class instance here as 'instance'
|
|
17
|
+
instance.someMethod();
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default MyPlugin;
|
|
22
|
+
|
|
23
|
+
```
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "beanbagdb",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.54",
|
|
4
4
|
"description": "A JS library to introduce a schema layer to a No-SQL local database",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"module": "src/index.js",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"scripts": {
|
|
9
|
-
"test": "mocha",
|
|
9
|
+
"test": "mocha;rm -rf test_database_*/;",
|
|
10
10
|
"docgen": "npx jsdoc -c jsdoc.json"
|
|
11
11
|
},
|
|
12
12
|
"repository": {
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"ajv": "^8.17.1",
|
|
31
31
|
"chai": "^5.1.1",
|
|
32
|
+
"chai-as-promised": "^8.0.0",
|
|
32
33
|
"dotenv": "^16.4.5",
|
|
33
34
|
"jsdoc": "^4.0.3",
|
|
34
35
|
"mocha": "^10.7.3",
|