New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

node-red-contrib-firebase-data

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-red-contrib-firebase-data - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

source/firebase_auth.html

11

package.json
{
"name": "node-red-contrib-firebase-data",
"version": "0.0.2",
"version": "0.0.3",
"author": "minh hien <taminhhien.mor.vn@gmail.com>",
"description": "The simplest of simple nodes with box note",
"dependencies": {
"request": "^2.88.0"
"request": "^2.88.0",
"firebase": "2.4.1",
"firebase-token-generator": "^2.0.0",
"follow-redirects": "0.0.7"
},

@@ -18,3 +21,5 @@ "keywords": [

"nodes": {
"firebase_config": "source/addFirebase.js"
"firebase_config": "source/firebase_config.js",
"firebase_auth": "source/firebase_auth.js",
"addFirebase": "source/addFirebase.js"
}

@@ -21,0 +26,0 @@ },

var request = require('request');
module.exports = function(RED) {
module.exports = function (RED) {
"use strict";
function addFirebase(n) {
RED.nodes.createNode(this,n);
RED.nodes.createNode(this, n);
this.box = RED.nodes.getNode(n.box);
var node = this;
var firebase = n.firebase
var newObj = JSON.parse(n.data)
var newObj = n.data
var methodValue = n.method
var childPath = n.childpath || ""
var jsonPath = ".json"
// console.log("func", n.func);
// console.log("data", n.data);
node.on("input", function(msg) {
// var newObj = msg.payload
node.on("input", function (msg) {
if (newObj == "") {
newObj = msg.payload
}
if (methodValue == "msg.method" || methodValue == "") {
methodValue = msg.method
}
var opts = {
method: "POST",
url: "https://" + firebase + ".firebaseio.com/.json",
body: JSON.stringify(newObj)
method: methodValue,
url: "https://" + firebase + ".firebaseio.com/" + childPath + jsonPath,
body: JSON.stringify(JSON.parse(newObj))
};
request(opts, function (error, response, body) {
if (error) {
node.error(error,{});
node.status({fill:"red",shape:"ring",text:"calendar.status.failed"});
return;
}
msg.payload = JSON.parse(body) || "Fail"
node.send(msg);
})
if (error) {
node.error(error, {});
node.status({
fill: "red",
shape: "ring",
text: "calendar.status.failed"
});
return;
}
if (methodValue == "delete") {
msg.payload = "Delete success!"
} else {
msg.payload = JSON.parse(body)
}
node.send(msg);
})
});
}
RED.nodes.registerType("addFirebase",addFirebase);
RED.nodes.registerType("addFirebase", addFirebase);
};

Sorry, the diff of this file is not supported yet

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