Gathering detailed insights and metrics for flux-capacitor-boot
Gathering detailed insights and metrics for flux-capacitor-boot
Gathering detailed insights and metrics for flux-capacitor-boot
Gathering detailed insights and metrics for flux-capacitor-boot
⚛ Event-based, functional data store. Bringing flux architecture to the backend.
npm install flux-capacitor-boot
Typescript
Module System
Min. Node Version
Node Version
NPM Version
64.8
Supply Chain
92
Quality
70.8
Maintenance
50
Vulnerability
98.9
License
JavaScript (95%)
CSS (3.84%)
HTML (1.16%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
31 Stars
162 Commits
5 Forks
2 Watchers
4 Branches
2 Contributors
Updated on Sep 15, 2023
Latest Version
0.2.2
Package Id
flux-capacitor-boot@0.2.2
Size
16.87 kB
NPM Version
3.10.3
Node Version
6.6.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Bootstrapping utils for the Flux Capacitor. Setting up a flux capacitor HTTP service in a simple, yet customizable way by using feature middlewares.
This will set up a flux capacitor service with RESTful routes for reading data, dispatching events and pushing realtime updates using a websocket:
1const authorize = require('flux-capacitor-boot/authorize') 2const { connectTo } = require('flux-capacitor-sequelize') 3const { 4 bootstrap, createExpressApp, createDispatcher, createStore, createWebSocket, use 5} = require('flux-capacitor-boot/express') 6 7const commands = require('./commands') 8const createCollections = require('./collections') 9const rootReducer = require('./reducers') 10 11bootstrap([ 12 use.app(createExpressApp()), 13 use.store(createStore(rootReducer, connectTo(process.env.DB_CONNECTION, createCollections))), 14 use.route('/dispatch/:commandName', createDispatcher(commands), (req) => authorize.allow()), 15 use.route('/events(/:id)?', createReadRoute('events', { sortBy: 'timestamp', sortOrder: 'DESC' })), 16 use.route('/notes(/:id)?', createReadRoute('notes')), 17 use.route('/websocket', createWebSocket()) 18]).listen(process.env.PORT)
1const { bootstrap, use } = require('flux-capacitor-boot/express') 2 3bootstrap([ 4 ... 5 6 // Optionally add custom express middlewares you need: 7 use.expressMiddleware([ someMiddleware ]), 8 9 // `use.*` just returns a function of this type: 10 ({ app, store }) => Promise.resolve({ app, store }) 11])
If you want to use an existing express app or want to use some custom app then just pass it to use.app()
instead of using createExpressApp()
:
1const bodyParser = require('body-parser') 2const express = require('express') 3const { bootstrap, use } = require('flux-capacitor-boot/express') 4 5const app = express() 6 7bootstrap([ 8 use.app(app), 9 use.expressMiddleware([ bodyParser.json() ]), // the dispatcher needs this middleware, createExpressApp() would have set it up for us 10 ... 11])
1const authorize = require('flux-capacitor-boot/authorize') 2const { bootstrap, createWebSocket, use } = require('flux-capacitor-boot/express') 3 4bootstrap([ 5 use.route('/some/route', someHandler, authorizeRoute), 6 use.route('/websocket', createWebSocket(authorizeEventPropagation)) 7]) 8 9// Must return authorize.allow() or authorize.deny(Error) or a promise. 10function authorizeRoute (req) { 11 if (!req.user) { 12 return authorize.deny('You are not logged in or there is no express middleware for authentication set.') 13 } 14 15 if (req.user === 'John') { 16 return authorize.allow() 17 } else { 18 // Can also pass an error object to `authorize.deny()` 19 return authorize.deny('Only John is allowed to use this route.') 20 } 21} 22 23function authorizeEventPropagation (event, websocket) { 24 return authorize.allow() 25}
Find it here 👉 Flux Capacitor
Released under the terms of the MIT license.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 1/12 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More