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.
postcss-strip-inline-comments
Advanced tools
Strip inline comments using the postcss-scss parser
A plugin to remove inline CSS comments from compilation.
/* This comment will remain */
// This comment will be removed
body {
// This comment will also be removed
background-color: black;
}
// And so will this one
You need to have a compliant parser, currently either postcss-scss or sugarss already parsing your postcss for this plugin to work.
###Install
npm install postcss-strip-inline-comments --save-dev
###Grunt
grunt.initConfig({
postcss: {
options: {
processors: [
require('postcss-strip-inline-comments'),
],
syntax: require('postcss-scss')
},
dist: {
src: 'css/*.css'
}
}
});
###Gulp
var gulp = require('gulp');
var postcss = require('gulp-postcss');
var stripInlineComments = require('postcss-strip-inline-comments');
var scss = require('postcss-scss');
gulp.task('default', function () {
var processors = [stripInlineComments];
return gulp.src('in.css')
.pipe(postcss(processors, {syntax: scss}))
.pipe(gulp.dest('out'));
});
###Webpack
var stripInlineComments = require('postcss-strip-inline-comments');
var config = {
...
module: {
loaders: [
{
test: /\.s?css$/,
loader: ExtractTextPlugin.extract('style-loader', 'css-loader?sourceMap&importLoaders=1!postcss-loader?parser=postcss-scss')
}
]
},
postcss: function(webpack) {
return [
stripInlineComments
];
},
...
}
###Node
import postcss from 'postcss';
import syntax from 'postcss-scss';
import stripInlineComments from 'postcss-strip-inline-comments';
let css = fs.readFileSync('style.css', 'utf8');
postcss([stripInlineComments]).process(css, { parser: syntax }).then( result => {
console.log(result.css);
});
0.1.5
FAQs
Strip inline comments using the postcss-scss parser
The npm package postcss-strip-inline-comments receives a total of 5,088 weekly downloads. As such, postcss-strip-inline-comments popularity was classified as popular.
We found that postcss-strip-inline-comments 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.