Security News
Research
Supply Chain Attack on Rspack npm Packages Injects Cryptojacking Malware
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
cerebral-module-useragent
Advanced tools
Adds useragent specs to your cerebral state model
A Cerebral module for everything user agent.
The useragent module puts information about the browser into your model, and it also updates this information when the size of the browser changes etc.
This project is still in alpha. To test alpha version check instructions in monorepo.
import {Controller} from 'cerebral'
import Useragent from 'cerebral-module-useragent'
const controller = Controller({
modules: {
useragent: Useragent({
// Use CSS media queries to determine
// custom sizes available in your model.
// They will be toggle between true/false in your
// model
media: {
small: '(min-width: 600px)',
medium: '(min-width: 1024px)',
large: '(min-width: 1440px)',
portrait: '(orientation: portrait)'
},
// store all feature tests in model
feature: true,
parse: {
// parse useragent.browser from ua string
browser: true,
// parse useragent.device from ua string
device: true
},
// check the docs at: https://github.com/HubSpot/offline#advanced
offline: {
checkOnLoad: false,
interceptRequests: true,
reconnect: {
initialDelay: 3,
delay: 1.5
},
requests: false
},
// update window size on resize
window: true
})
}
})
The useragent module will populate your model on the given namespace. All you need to do in your view layer is to grab whatever data you need from it, for example media:
export default connect({
media: 'useragent.media.*'
}, ...)
FAQs
Adds useragent specs to your cerebral state model
The npm package cerebral-module-useragent receives a total of 0 weekly downloads. As such, cerebral-module-useragent popularity was classified as not popular.
We found that cerebral-module-useragent demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.
Security News
Sonar’s acquisition of Tidelift highlights a growing industry shift toward sustainable open source funding, addressing maintainer burnout and critical software dependencies.