Socket
Socket
Sign inDemoInstall

@node-red/runtime

Package Overview
Dependencies
Maintainers
2
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@node-red/runtime - npm Package Compare versions

Comparing version 1.2.0-beta.1 to 1.2.0

27

lib/nodes/context/localfilesystem.js

@@ -140,4 +140,3 @@ /**

function writeFileAtomic(storagePath, content) {
async function writeFileAtomic(storagePath, content) {
// To protect against file corruption, write to a tmp file first and then

@@ -147,6 +146,6 @@ // rename to the destination file

let tmpFile = finalFile + "."+Date.now()+".tmp";
return fs.outputFile(tmpFile, content, "utf8").then(function() {
return fs.rename(tmpFile,finalFile);
})
await fs.outputFile(tmpFile, content, "utf8");
return fs.rename(tmpFile,finalFile);
}
function LocalFileSystem(config){

@@ -174,2 +173,3 @@ this.config = config;

var promises = [];
var contextFiles = [];
return listFiles(self.storageBaseDir).then(function(files) {

@@ -185,3 +185,5 @@ files.forEach(function(file) {

}
promises.push(loadFile(path.join(self.storageBaseDir,file)));
let contextFile = path.join(self.storageBaseDir,file);
contextFiles.push(contextFile)
promises.push(loadFile(contextFile));
})

@@ -191,6 +193,11 @@ return Promise.all(promises);

scopes.forEach(function(scope,i) {
var data = res[i]?JSON.parse(res[i]):{};
Object.keys(data).forEach(function(key) {
self.cache.set(scope,key,data[key]);
})
try {
var data = res[i]?JSON.parse(res[i]):{};
Object.keys(data).forEach(function(key) {
self.cache.set(scope,key,data[key]);
})
} catch(err) {
let error = new Error(log._("context.localfilesystem.invalid-json",{file: contextFiles[i]}))
throw error;
}
});

@@ -197,0 +204,0 @@ }).catch(function(err){

@@ -179,2 +179,3 @@ {

"localfilesystem": {
"invalid-json": "Invalid JSON in context file '__file__'",
"error-circular": "Context __scope__ contains a circular reference that cannot be persisted",

@@ -181,0 +182,0 @@ "error-write": "Error writing context: __message__"

{
"name": "@node-red/runtime",
"version": "1.2.0-beta.1",
"version": "1.2.0",
"license": "Apache-2.0",

@@ -19,4 +19,4 @@ "main": "./lib/index.js",

"dependencies": {
"@node-red/registry": "1.2.0-beta.1",
"@node-red/util": "1.2.0-beta.1",
"@node-red/registry": "1.2.0",
"@node-red/util": "1.2.0",
"async-mutex": "0.2.4",

@@ -23,0 +23,0 @@ "clone": "2.1.2",

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