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.
a tool to convert rpx to rem
##How to convert static files
npm install rpx-rem -g
rpx2rem
you can set a config
rpx2rem --config rpxrem.config.js
##config
default config:
{
patterns: "**/*.css",
rpxToRemRatio: 0.01,
ignoreCss: [],
isReplace: false,
convertBorder1rpx: false
}
you can create a new file in the current directory, for example: rpxrem.config.js
module.exports = {
patterns: "./WrcIosselect/lib/WrcIosselect.css",
rpxToRemRatio: 0.01,
ignoreCss: ['font-size', 'line-height'],
isReplace: false,
convertBorder1px: true
};
then you can run like this:
rpx2rem --config rpxrem.config.js
##parammeter
patterns: visite https://www.npmjs.com/package/glob to see pattern
rpxToRemRatio: the ratio of rpx and rem
ignoreCss: will not convert the CSS property
isReplace: whether or not to replace the original file
convertBorder1rpx: whether or not to convert 1 pixel wide border
##How to use as a webpack loader
package.json:
"devDependencies": {
"rpx-rem": "*"
}
in webpack.config.js:
module.exports = {
node: {
fs: "empty"
},
module: {
loaders: [
{
test: /\.css$/,
loader: 'style-loader!css-loader!rpx-rem!postcss-loader!less-loader'
}
]
}
}
If you use less-loader, sass-loader, postcss-loader and other processing tools, you need to put rpx-rem on their left
you must create a file called rpxrem.webpack.conf.json in the project root directory (same directory with package.json) like this:
{
"rpxToRemRatio": 0.01,
"ignoreCss": [],
"convertBorder1rpx": true
}
then you can convert rpx to rem in your project
FAQs
a tool to convert rpx to rem
We found that rpx-rem 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.