Registry / devops / spring-river

spring-river

JSON →
library1.0.36jsnpmunverified

Spring River is an experimental, asynchronous queue-based microservices framework for Node.js (v1.0.36). It implements the Rapids/Rivers/Ponds pattern, where 'rivers' produce solutions and 'springs' generate needs, communicating via AMQP (e.g., RabbitMQ). Key differentiators include a simple bootstrap approach inspired by ZEIT's Micro, built-in predicate decorators for packet filtering, and environment-based AMQP address configuration. However, the project is marked as experimental and has not seen updates since 2017, making it unsuitable for production use.

npm install spring-river
INSTALL
IMPORT
SIG · SPRING-RIVER
S
spring-river
devopsjavascriptv1.0.36
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.

river
module.exports = (packet, publish) => { ... }
const river = require('spring-river').river
No explicit import needed; the 'river' binary is used via scripts.start in package.json and exports a function from your module.
spring
module.exports = (publish) => { ... }
const spring = require('spring-river').spring
No explicit import needed; the 'spring' binary is used via scripts.start and exports a function that takes only a publish callback.
forbid-keys
const forbidKeys = require('spring-river/predicates/forbid-keys');
const { forbidKeys } = require('spring-river');
Built-in predicates are not exported from main package; import from specific path.
require-keys
const requireKeys = require('spring-river/predicates/require-keys');
import { requireKeys } from 'spring-river';
Package uses CommonJS, not ESM. Import from predicates subpath.

Shows how to create a simple 'river' microservice that adds a solution to a packet and publishes it via AMQP.

// package.json { "main": "index.js", "name": "my-river", "scripts": { "start": "river" } } // index.js module.exports = (packet, publish) => { packet.solution = 42; publish(packet); }; // Run ADDRESS=amqp://localhost npm start
Debug
Known issues
deprecatedPackage has not been updated since 2017 and is considered abandoned.
fix
Consider using an alternative like RapidsRivers (Python/Java) or a more modern Node.js microservices framework.
affects: *
breakingThe library requires RabbitMQ or another AMQP-compatible broker. No fallback for missing broker.
fix
Ensure a RabbitMQ instance is running and ADDRESS is set correctly before starting services.
affects: *
gotchaPredicates are not exported from the main package; they must be required via full path (e.g., 'spring-river/predicates/forbid-keys').
fix
Use exact path: require('spring-river/predicates/forbid-keys')
affects: *
gotchaThe 'river' and 'spring' binaries are not actual modules; they are CLI scripts invoked via npm start. Direct require will fail.
fix
Do not attempt to require('spring-river/river') or require('spring-river/spring') in code.
affects: *
Errors
Common errors & fixes
Error: Cannot find module 'spring-river/predicates/forbid-keys'
Incorrect import path; forgetting to include '/predicates/'
fix
const forbidKeys = require('spring-river/predicates/forbid-keys');
Error: connect ECONNREFUSED 127.0.0.1:5672
RabbitMQ is not running or ADDRESS is not set
fix
Start RabbitMQ (e.g., docker run -d --name rabbitmq -p 5672:5672 rabbitmq) and set ADDRESS=amqp://localhost before running npm start
TypeError: publish is not a function
Exporting function incorrectly for a 'river' (should accept two arguments) or for a 'spring' (should accept one argument)
fix
For river: module.exports = (packet, publish) => { ... }. For spring: module.exports = (publish) => { ... }
Upgrade
Version history
1.0.36latest on npm
Audit
Dependencies
amqplibrequiredAMQP client library required for RabbitMQ connectivity
dotenvoptionalOptional for loading AMQP address from .env file
Agent activity
10 hits · last 30 days
node
9
Resources
spring-river — npm install spring-river · libregistry