Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
redux-cli-logger
Advanced tools
Readme
No innovations here, just a logger middleware for redux that will write all redux actions and state changes to the node.js console.
Configuration and output format inspired by redux-logger
npm install --save-dev redux-cli-logger
redux-cli-logger must be called as a function before being utilized as middleware. This allows passing in options to overwrite all colors and arrow icons, as well as a predicate that functions like that in redux-logger. Here's what a simple configureStore function might look like:
import reducer from '../reducers'
import createCLILogger from 'redux-cli-logger'
const middleware = [
// your middleware here
]
if (process.env.NODE_ENV === 'development') {
const loggerOptions = {
predicate: (getState, action) => !action.MONITOR_ACTION
}
const logger = createCLILogger(loggerOptions)
middleware.push(logger)
}
const enhancer = compose(
applyMiddleware(...middleware)
// optionally, electron-enhancer, redux-loop, etc.
)
const initialState = {}
const store = createStore(reducer, initialState, enhancer)
The options object has overridable defaults that look like this:
{
downArrow: '▼',
rightArrow: '▶',
messageColor: 'bright-yellow',
prevColor: 'grey',
actionColor: 'bright-blue',
nextColor: 'green',
log: console.log,
// when non-null, only prints if predicate(getState, action) is truthy
predicate: null,
// useful to trim parts of the state atom that are too verbose
stateTransformer: (state) => state,
// useful to censor private messages (containing password, etc.)
actionTransformer: (action) => action,
}
FAQs
Redux logger for a node environment
We found that redux-cli-logger 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
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).