Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.