Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-nk-base

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-nk-base - npm Package Compare versions

Comparing version 2.0.9 to 2.1.0

92

index.js

@@ -17,4 +17,5 @@ function NKB(basefile) {

const fs = require('fs');
var bt = fs.readFileSync(basefile, 'utf-8');
var lastBaseFileUpdate;
let bt = fs.readFileSync(basefile, 'utf-8');
let lastBaseFileUpdate;
let changed = false;

@@ -56,21 +57,3 @@ fs.writeFileSync(basefile, bt, 'utf-8');

function wb(newtx) {
try {
fs.writeFileSync(basefile, newtx, 'utf-8');
lastBaseFileUpdate = fs.statSync(basefile).mtimeMs;
fs.writeFileSync(basefile + '.reserve', newtx, 'utf-8');
return true;
} catch {
console.error(`node-nk-base writeBase: can't write file with this path(${basefile})!`);
return null;
}
}
this.bool = '±';

@@ -269,3 +252,5 @@ this.num = 'ň';

if(wb(bt)) return true; else return null;
changed = true;
return true;

@@ -321,4 +306,6 @@ }

if(wb(bt)) return true; else return null;
changed = true;
return true;
}

@@ -373,3 +360,5 @@

if(wb(bt)) return true; else return null;
changed = true;
return true;

@@ -466,4 +455,6 @@ }

if(wb(bt)) return true; else return false;
changed = true;
return true;
}

@@ -489,4 +480,6 @@

if(wb(bt)) return true; else return null;
changed = true;
return true;
}

@@ -583,10 +576,8 @@

newbt += `` + bt.substring(se, bt.length);
bt = newbt;
newbt = null;
if(!err) {
changed = true;
if(wb(bt)) return true; else return null;
} else return null;
return true;

@@ -623,4 +614,6 @@ }

if(wb(bt)) return true; else return null;
changed = true;
return true;
}

@@ -785,4 +778,6 @@

if(wb(bt)) return true; else return null;
changed = true;
return true;
}

@@ -825,3 +820,5 @@

if(wb(bt)) return true; else return null;
changed = true;
return true;

@@ -1130,8 +1127,35 @@ }

}
new Promise(async () => {
for(;;) {
console.log(`node-nk-base started on file "${basefile}"`);
await new Promise((resolve) => setTimeout(resolve, 1000));
if(changed) {
changed = false;
try {
fs.writeFileSync(basefile, newtx, 'utf-8');
lastBaseFileUpdate = fs.statSync(basefile).mtimeMs;
fs.writeFileSync(basefile + '.reserve', newtx, 'utf-8');
} catch {
console.error(`node-nk-base writeBase: can't write file with this path(${basefile})!`);
}
}
}
});
console.log(`node-nk-base started on file "${basefile}"`);
}
module.exports = NKB;
{
"name": "node-nk-base",
"version": "2.0.9",
"version": "2.1.0",
"description": "database for nodejs by NK",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc