
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@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 566 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
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.