Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Postgres
✓ const Postgres = require('noflo-pg/components/Postgres')
✗ import Postgres from 'noflo-pg'
NoFlo components are loaded as individual files; the package does not provide a main entry point for direct import.
Group
✓ const Group = require('noflo-pg/components/Group')
✗ const { Group } = require('noflo-pg')
Group component is separate. Import via full path.
Placeholder
✓ const Placeholder = require('noflo-pg/components/Placeholder')
✗ import { Placeholder } from 'noflo-pg'
Placeholder component is separate. Use CommonJS require with full path.
Sets up a NoFlo graph to connect to a PostgreSQL database and execute a parameterized query using Group and Placeholder components.
const noflo = require('noflo');
const Postgres = require('noflo-pg/components/Postgres');
const Group = require('noflo-pg/components/Group');
const Placeholder = require('noflo-pg/components/Placeholder');
const network = noflo.createNetwork();
// Define graph
const graph = new noflo.Graph('pg-example');
graph.addNode('pg', 'Postgres');
graph.addNode('group', 'Group');
graph.addNode('placeholder', 'Placeholder');
graph.addEdge('placeholder', 'out', 'pg', 'template');
graph.addEdge('group', 'out', 'pg', 'in');
graph.addInitial('tcp://localhost:5432/postgres', 'pg', 'server');
graph.addInitial('SELECT * FROM &table', 'placeholder', 'template');
graph.addInitial('table', 'group', 'group');
graph.addInitial('users', 'group', 'in');
network.load(graph, () => {
console.log('Graph started');
});
Errors
Common errors & fixes
Cannot find module 'noflo-pg'
Package does not export a main index.js; components are in subfolders.
fixImport specific components: require('noflo-pg/components/Postgres') Error: connect ECONNREFUSED 127.0.0.1:5432
PostgreSQL server is not running or connection string is incorrect.
fixEnsure PostgreSQL is running and use correct connection URI: 'tcp://user:pass@localhost:5432/db'
TypeError: Cannot read properties of undefined (reading 'table')
Placeholder template contains '&table' but no Group input with group 'table' was provided.
fixPass a value grouped by the placeholder name (e.g., 'table') to the Postgres component.
Audit
Dependencies
noflorequiredCore NoFlo runtime required to use components and graphs
pgrequiredNode-postgres library for PostgreSQL connectivity