Registry / storage / node-red-contrib-storagemodule-postgres-yunzai

node-red-contrib-storagemodule-postgres-yunzai

JSON →
library1.0.51jsnpmunverified

Provides Node-RED persistence using PostgreSQL instead of the default filesystem. Current version is 1.0.51, with moderate release cadence (6 releases to date). Key differentiator: enables multi-instance Node-RED deployments with shared state via PostgreSQL, supports flows, credentials, settings, library storage. Alternative to filesystem-based storage. Note: sessions and projects are not implemented; error handling is minimal.

npm install node-red-contrib-storagemodule-postgres-yunzai
INSTALL
IMPORT
SIG · NODE-RED-CONTRIB-S
N
node-red-contrib-storagemodule-postgres-yunzai
storagejavascriptv1.0.51
harness data pending
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.

default
const storageModule = require("node-red-contrib-storagemodule-postgres")
import storageModule from "node-red-contrib-storagemodule-postgres"
CommonJS only; ESM not supported. Used in settings.js.
storageModule
const storageModule = require("node-red-contrib-storagemodule-postgres")
const { storageModule } = require("node-red-contrib-storagemodule-postgres")
The module exports a single function, not an object. Destructuring returns undefined.
default config key
storageModule: require("node-red-contrib-storagemodule-postgres")
storageModule: require("node-red-contrib-storagemodule-postgres").default
Do not use .default; the require returns the function directly.

Configures Node-RED to use PostgreSQL for persistence by adding storageModule and postgresURI to settings.js.

// In ~/.node-red/settings.js const storageModule = require('node-red-contrib-storagemodule-postgres'); module.exports = { // ... other settings storageModule: storageModule, postgresURI: process.env.POSTGRES_URI || 'postgres://user:pass@localhost:5432/nodered', postgresSchema: 'public', autoInstallModules: true, userDir: '/home/user/.node-red/' };
Debug
Known issues
breakingsessions are not implemented; session persistence will fail silently.
fix
If sessions are required, do not use this module; consider filesystem or another storage backend.
affects: >=1.0.0
breakingprojects are not implemented; Node-RED project features will not persist.
fix
Avoid using Node-RED project features with this module.
affects: >=1.0.0
deprecatedThe module uses 'pg' (node-postgres) but does not support connection pooling; each operation opens a new connection.
fix
Consider wrapping with a connection pool if performance is critical.
affects: >=1.0.0
gotchaError handling is minimal; errors are printed to console but not thrown, so Node-RED may continue in an inconsistent state.
fix
Monitor Node-RED logs for PostgreSQL errors; implement custom error handling if needed.
affects: >=1.0.0
gotchaThe module requires the 'pg' package to be installed; it is not listed as a dependency in package.json.
fix
Run 'npm install pg' in your Node-RED user directory before using this module.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'pg'
pg dependency is not automatically installed
fix
npm install pg --save in the Node-RED user directory
Error: getaddrinfo ENOTFOUND postgressIP
Invalid or unreachable PostgreSQL host in postgresURI
fix
Verify the postgresURI connection string and network connectivity
TypeError: storageModule is not a function
Incorrect import syntax (destructuring or ESM import)
fix
Use: const storageModule = require('node-red-contrib-storagemodule-postgres')
Upgrade
Version history
1.0.51latest on npm
Audit
Dependencies
pgrequiredPostgreSQL client for Node.js
Agent activity
18 hits · last 30 days
node
16
Amazon
1
Resources
node-red-contrib-storagemodule-postgres-yunzai — npm install node-red-contrib-storagemodule-postgres-yunzai · libregistry