
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
Stupid-simple event sourcing.
An event-driven persistence for the application layer inspired by Redux.
Note: this currently provides an in-memory implementation, not suitable for production
const { createStore, adapters: { InMemory } } = require('reventor')
// Just like Redux, a reducer takes the previous state and a
// current event to produce the next state. This reducer will be used
// to map over a set of events for a given aggregate
function reducer (previousState = {}, event) {
const { eventType, data } = event
switch (eventType) {
case 'acct:created':
return { ...data, balance: 0 }
case 'acct:deposit':
return {
...previousState,
balance: previousState.balance + data.amount
}
case 'acct:withdrawal':
return {
...previousState,
balance: previousState.balance - data.amount
}
}
default:
return previousState
}
}
const adapter = new InMemory()
const { dispatch, getState } = createStore(adapter, reducer)
module.exports = { dispatch, getState }
A function for dispatching events which takes a single event, or array of event objects.
dispatch({
eventType: 'account:create'
aggregateId: 'account:1234',
aggregateVersion: 0,
data: {
owner: {
email: 'owner@example.com',
phone: {
type: 'cell'
number: '+15628675309'
}
}
createdAt: Date.now(),
}
})
Get the state of an aggreaget.
getState('account:1234')
FAQs
An event-driven persistence layer for the server inspired by redux.
The npm package reventor receives a total of 2 weekly downloads. As such, reventor popularity was classified as not popular.
We found that reventor demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.