molly-db 1.0.20 → 1.0.21
Sign up to get free protection for your applications and to get access to all the features.
- package/module/_init_.js +2 -2
- package/package.json +1 -1
package/module/_init_.js
CHANGED
@@ -5,7 +5,7 @@ function fillDB( _db, _table, _path ){
|
|
5
5
|
let _itr = undefined;
|
6
6
|
|
7
7
|
if( (/^http/).test(_path) ){ try{
|
8
|
-
const stream = await fetch
|
8
|
+
const stream = await fetch(_path,{responseType:'stream'});
|
9
9
|
_itr = readline.createInterface({ input: stream })
|
10
10
|
} catch(e) { console.log(`error reading ${_path}`); return response(); }}
|
11
11
|
|
@@ -31,7 +31,7 @@ function fillDB( _db, _table, _path ){
|
|
31
31
|
const path = `${query.path}/_init_.json`;
|
32
32
|
|
33
33
|
if( (/^http/).test(query.path) ){
|
34
|
-
const stream = await fetch
|
34
|
+
const stream = await fetch(path);
|
35
35
|
db._init_ = stream.data;
|
36
36
|
} else{
|
37
37
|
db._buff_ = fs.readFileSync( path );
|