Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
procss
Advanced tools
Readme
Plugins-based CSS post-processor to modify CSS with JavaScript.
It uses /* procss.<command_name>([<command_params>...]) */
CSS comments to
to run processors <command_name>
handlers in the relative context.
So, Procss
allows you to use specific processors for specific cases.
It uses PostCSS
to parse CSS and provide a usable JS API to edit CSS node trees.
Install with npm:
$ [sudo] npm install procss --save
If you want to use procss
on your cli install with:
$ [sudo] npm install procss -g
Usage:
$ procss [OPTIONS]
Options:
-h, --help : Help
-v, --version : Version
-i INPUT, --input=INPUT : Glob string(s) or file path(s) to process, "-" for STDIN
-o OUTPUT, --output=OUTPUT : Output file, "-" for STDOUT, by default '?.pro.css'
-p PLUGINS, --plugins=PLUGINS : Plugins to use.
Arguments:
INPUT : Alias to --input
Example:
$ procss test.css -p pluginName
or
$ procss test.css -o ?.processed.css -p pluginName
or
$ procss test.css test2.css -o ?.processed.css -p pluginName
or
$ procss '*test*.css' -o ?.processed.css -p pluginName
$ cat test.css | procss -i - -o - -p pluginName > ?.processed.css
Usage:
require('procss')
.run(options)
.then(cb);
Options:
Example:
require('procss')
.run({
input : '*test*.css',
output : '?.processed.css',
plugins : [ 'pluginName', 'pluginPath/pluginName' ]
})
.then(cb);
You can predefine options in .procss.js
config files like this:
module.exports = {
output : 'changed_?.css',
plugins : [ 'some-plugin' ]
}
'?'
in output
is an input file name mask.
Proccs
uses the nearest to input file config, so it will try to find .procss.js
in each folder from input path to root.
If you want to define configs depending on the input file path, you can use wildcard patterns:
module.exports = [
{
file_paths : 'dirA/**/*.css',
config : {
output : 'changed_?.css',
plugins : [ 'some-plugin' ]
}
},
{
file_paths : [ 'dirA/a.css', 'dirB/*.css' ],
config : {
output : 'changed-once-more_?.css'
}
}
]
Each matched config will extend the previous one, so for /dirA/a.css
input file it will be:
{
output : 'changed-once-more_?.css',
plugins : [ 'some-plugin' ]
}
Plugins can be defined by npm package name and/or by absolute or relative to config path:
module.exports = {
'plugins' : [ 'some-plugin"', 'my-super-plugin/plugin.js' ]
}
Plugins are processed in order, so definition order is significant.
Plugins can also have their own configs:
[
{
file_paths : 'dirA/**/*.css',
config : {
plugins : [
{
plugin : 'some-plugin',
config : { 'some-prop' : 'some-val' }
}
]
}
},
{
file_paths : [ 'dirA/a.css', 'dirB/*.css' ],
config : {
plugins : [
{
plugin : 'some-plugin',
config : { 'some-prop' : 'some-another-val' }
},
{
plugin : 'my-super-plugin/plugin.js',
config : { 'some-another-prop' : 'some-another-val' }
}
]
}
}
]
Plugin is a simple Node.js module, which must export object with at least one API methods:
before - will be called before start to process input files.
beforeEach - will be called before start to process commands in file.
process - will be called to process each parsed command.
afterEach - will be called after finish to process file.
after - will be called after finish to process files.
@todo
FAQs
Plugins-based CSS post-processor
The npm package procss receives a total of 2 weekly downloads. As such, procss popularity was classified as not popular.
We found that procss 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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.