postcss-processor

0.1.2 • Public • Published

postcss-processor

Sugar way to create a postcss processor or get postcss plugins

Usage

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) to resolve the pluginNames

Type: Function

Used to resolve the pluginNames, with signature resolve(id)

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.2
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.2
    1
  • 0.1.1
    1
  • 0.1.0
    0
  • 0.0.1
    1

Package Sidebar

Install

npm i postcss-processor

Weekly Downloads

3

Version

0.1.2

License

MIT

Last publish

Collaborators

  • zoubin