Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zoubin/postcss-processor
Sugar way to create a postcss processor or get postcss plugins
https://github.com/zoubin/postcss-processor
Last synced: 8 days ago
JSON representation
Sugar way to create a postcss processor or get postcss plugins
- Host: GitHub
- URL: https://github.com/zoubin/postcss-processor
- Owner: zoubin
- Created: 2015-06-17T10:01:45.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-06-18T04:15:08.000Z (over 9 years ago)
- Last Synced: 2024-11-08T05:44:05.266Z (11 days ago)
- Language: JavaScript
- Size: 137 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# postcss-processor
Sugar way to create a postcss processor or get postcss plugins## Usage
```javascript
var Processor = require("postcss-processor")var plugins = Processor.plugin(
["postcss-node-plugin", "./local-plugin"],
null,
{ basedir: __dirname + "/plugins" }
)console.log("Plugins to be used:", plugins.map(function (p) {
return p.postcssPlugin
}))
// Plugins to be used: [ 'postcss-node-plugin', 'local-plugin' ]var processor = Processor(
["postcss-node-plugin", "./local-plugin"],
null,
{ basedir: __dirname + "/plugins" }
)```
### processor = Processor(pluginNames, opts, resolveOpts)
Resolve the plugins according to `pluginNames`, and return a processor using them.
### plugins = Processor.plugin(pluginNames, opts, resolveOpts)
Resolve the plugins
#### opts
Options map for each plugin. Key is the name, and value is the option.
#### resolveOpts
Type: `Object`
Directly passed to [resolve.sync(id, opts)](https://github.com/substack/node-resolve#resolvesyncid-opts) to resolve the `pluginNames`
Type: `Function`
Used to resolve the `pluginNames`, with signature `resolve(id)`