
Research
/Security News
Toptal’s GitHub Organization Hijacked: 10 Malicious Packages Published
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
github.com/callum/redux-routing
Universal routing built on top of redux.
For usage with React see example/main.js. See redux-routing-universal-example for an example of a universal application that renders on both client and server.
npm install redux-routing --save
import { applyMiddleware, createStore } from 'redux'
import { createMiddleware, History, match, navigate, reducer, route } from 'redux-routing'
// define routes
const routes = [
route('/', () => console.log('navigated to /')),
route('/foo', () => console.log('navigated to /foo')),
route('/foo/:bar', () => console.log('navigated to /foo/:bar'))
]
// create routing middleware, set up with HTML5 History
const middleware = createMiddleware(History)
// create store with middleware
const createStoreWithMiddleware = applyMiddleware(middleware)(createStore)
const store = createStoreWithMiddleware(reducer)
// subscribe to changes
store.subscribe(() => {
const route = store.getState()
const matched = match(route.href, routes)
if (matched) {
matched.handler()
} else {
console.log('404 not found')
}
})
// start navigating
store.dispatch(navigate('/'))
// logs 'navigated to /'
store.dispatch(navigate('/foo'))
// logs 'navigated to /foo'
store.dispatch(navigate('/foo/123'))
// logs 'navigated to /foo/:bar'
store.dispatch(navigate('/foo/bar/baz'))
// logs '404 not found'
See path-parser for more detail on defining routes.
FAQs
Unknown package
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.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.
Research
/Security News
Socket researchers investigate 4 malicious npm and PyPI packages with 56,000+ downloads that install surveillance malware.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.