Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
redux-cli-logger
Advanced tools
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
The npm package redux-cli-logger receives a total of 888 weekly downloads. As such, redux-cli-logger popularity was classified as not popular.
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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.