molly-db 1.0.17 → 1.0.21

Sign up to get free protection for your applications and to get access to all the features.
package/main.js CHANGED
@@ -1,5 +1,4 @@
1
1
  const worker = require('worker_threads');
2
- const fetch = require('axios');
3
2
  const url = require('url');
4
3
  const fs = require('fs');
5
4
 
@@ -16,13 +15,11 @@ function config( _config ) {
16
15
  /* --------------------------------------------------------------------------------------- */
17
16
 
18
17
  class molly_db{
19
-
20
18
  constructor( opt ){ if( opt.pass )
21
19
  this.pass = opt.pass; this.port = opt.port || 27017;
22
20
  this.path = opt.path.replace( /^\./,process.cwd() );
23
21
  return require(`${__dirname}/module/_worker_.js`)(this);
24
22
  }
25
-
26
23
  }
27
24
 
28
25
  /* --------------------------------------------------------------------------------------- */
package/module/_init_.js CHANGED
@@ -5,10 +5,8 @@ function fillDB( _db, _table, _path ){
5
5
  let _itr = undefined;
6
6
 
7
7
  if( (/^http/).test(_path) ){ try{
8
- const stream = await fetch.get(_path,{responseType:'stream'});
9
- _itr = readline.createInterface({
10
- input: stream.data
11
- })
8
+ const stream = await fetch(_path,{responseType:'stream'});
9
+ _itr = readline.createInterface({ input: stream })
12
10
  } catch(e) { console.log(`error reading ${_path}`); return response(); }}
13
11
 
14
12
  else if( fs.existsSync(_path) )
@@ -33,7 +31,7 @@ function fillDB( _db, _table, _path ){
33
31
  const path = `${query.path}/_init_.json`;
34
32
 
35
33
  if( (/^http/).test(query.path) ){
36
- const stream = await fetch.get(path);
34
+ const stream = await fetch(path);
37
35
  db._init_ = stream.data;
38
36
  } else{
39
37
  db._buff_ = fs.readFileSync( path );
@@ -2,8 +2,8 @@ const worker = require('worker_threads');
2
2
  const readline = require('readline');
3
3
  const crypto = require('./_crypto_');
4
4
  const { Buffer } = require('buffer');
5
+ const fetch = require('molly-fetch');
5
6
  const cluster = require('cluster');
6
- const fetch = require('axios');
7
7
  const http = require('http');
8
8
  const url = require('url');
9
9
  const fs = require('fs');
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "license": "MIT",
3
3
  "main": "main.js",
4
- "version": "1.0.17",
4
+ "version": "1.0.21",
5
5
  "name": "molly-db",
6
6
  "author": "bececrazy",
7
7
  "scripts": {
@@ -9,9 +9,9 @@
9
9
  },
10
10
  "repository": "https://github.com/EDBC-REPO-NPM/Molly-db",
11
11
  "dependencies": {
12
- "axios": "^0.27.2",
13
- "crypto-js": "^4.1.1",
14
- "fs": "^0.0.1-security"
12
+ "molly-fetch": "^1.0.8",
13
+ "fs": "^0.0.1-security",
14
+ "crypto-js": "^4.1.1"
15
15
  },
16
16
  "description": "Molly-db is a free and open source library for nodejs that allow you create a lightweight encrypted database using Json files",
17
17
  "keywords": [