
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@node-red/flow-parser
Advanced tools
This module provides a set of utilities for working with Node-RED flows.
const fs = require("fs");
const { parseFlow } = require("@node-red/flow-parser");
// Load the flow json from a local file and parse to an object
const exampleFlow = JSON.parse(fs.readFileSync("flows.json", "utf-8"));
// Parse the flow
const flow = parseFlow(exampleFlow);
// `flow` is now an object that can be used to explore the flow structure
walkThe walk function can be used to invoke a function on every object in the flow
configuration in a reasonably well-defined order:
const fs = require("fs");
const FlowParser = require("@node-red/flow-parser");
// Load the flow json from a local file and parse to an object
const exampleFlow = JSON.parse(fs.readFileSync("flows.json", "utf-8"));
const flow = FlowParser.parseFlow(exampleFlow);
flow.walk(function(obj) {
switch(obj.TYPE) {
case FlowParser.types.Flow:
// A flow object
break;
case FlowParser.types.Subflow:
// A subflow definition
break;
case FlowParser.types.Group:
// A group object
break;
case FlowParser.types.ConfigNode:
// A config node
break;
case FlowParser.types.Node:
// A flow node
break;
}
})
exportThe export function gives back the JSON array for the flow.
The following example will disable all Debug nodes in the flow:
const flow = parseFlow(exampleFlow);
flow.walk(obj => {
if (obj.type === 'debug') {
obj.active = false;
}
});
const newFlow = flow.export();
FAQs
Parser Utility for Node-RED Flow JSON
The npm package @node-red/flow-parser receives a total of 390 weekly downloads. As such, @node-red/flow-parser popularity was classified as not popular.
We found that @node-red/flow-parser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.