Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
fuzzy-color
Advanced tools
Fuzzy color is a utility that takes a string and does its absolute best to parse a meaningful color value from it.
Fuzzy color is a utility that takes a string and does its absolute best to parse a meaningful color value from it. It takes all the everyday color formats plus a few rarer ones that are (unfortunately) out there.
rgb(0, 0, 0)
rgba(0, 0, 0, 0)
#000
#000000
#000000
R:0 G:0 B:0
(R0 / G0 / B0)
There is also an 'assume' mode. When the assume parameter is passed we can parse values like 0 0 0
and assume they
are a certain color format. Some examples would be rgb
, hsl
, hsv
. If there are 4 numbers
(0 0 0 0.5
) it will always assume it is rgba
.
npm install fuzzy-color
var fuzzycolor = require('fuzzy-color');
var color1 = fuzzycolor('rgb(34,210,222)');
console.log(color1);
// { string: 'rgb(34,210,222)', raw: [ 34, 210, 222 ], type: 'rgb' }
var color2 = fuzzycolor('34, 210, 222', 'hsv');
console.log(color2);
// { string: 'hsv(34,210,222)', raw: [ 34, 210, 222 ], type: 'hsv' }
MIT
FAQs
Fuzzy color is a utility that takes a string and does its absolute best to parse a meaningful color value from it.
We found that fuzzy-color 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 researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
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.