Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
is-css-unit
Advanced tools
Check if a given value contains a valid CSS unit
npm install --save is-css-unit
const isCSSUnit = require('is-css-unit').isCSSUnit;
console.log(isCSSUnit('300px'))
// => true
console.log(isCSSUnit('10bark'))
// => false
If you need more specific checks, you can require different functions:
isFontUnit
: checks for all relative font units (em
, ex
, ch
, rem
)isViewportUnit
: checks for all viewport units (vw
, vh
, vmin
, vmax
)isAbsoluteUnit
: checks for all absolute units (cm
, mm
, q
, in
, pt
, pc
, px
)isAngleUnit
: checks for all angle units (deg
, grad
, rad
, turn
)isDurationUnit
: checks for all duration units (s
, ms
)isFrequencyUnit
: checks for all frequency units (Hz
, kHz
)isResolutionUnit
: checks for all resolution units (dpi
, dpcm
, dppx
)is-css-unit
is licensed under the MIT License
FAQs
Check if a given value contains a valid CSS unit
The npm package is-css-unit receives a total of 975 weekly downloads. As such, is-css-unit popularity was classified as not popular.
We found that is-css-unit 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.