UNPKG

motion

Version:

motion - moving development forward

76 lines (75 loc) 5.19 kB
{ "_args": [ [ "postcss-filter-plugins@https://registry.npmjs.org/postcss-filter-plugins/-/postcss-filter-plugins-2.0.0.tgz", "/Users/nw/flint/packages/flint" ] ], "_from": "postcss-filter-plugins@>=2.0.0 <3.0.0", "_id": "postcss-filter-plugins@2.0.0", "_inCache": true, "_location": "/postcss-filter-plugins", "_phantomChildren": {}, "_requested": { "name": "postcss-filter-plugins", "raw": "postcss-filter-plugins@https://registry.npmjs.org/postcss-filter-plugins/-/postcss-filter-plugins-2.0.0.tgz", "rawSpec": "https://registry.npmjs.org/postcss-filter-plugins/-/postcss-filter-plugins-2.0.0.tgz", "scope": null, "spec": "https://registry.npmjs.org/postcss-filter-plugins/-/postcss-filter-plugins-2.0.0.tgz", "type": "remote" }, "_requiredBy": [ "/cssnano" ], "_resolved": "https://registry.npmjs.org/postcss-filter-plugins/-/postcss-filter-plugins-2.0.0.tgz", "_shasum": "acce5d18c40e51be598911b6eca8b54d9e5bdedf", "_shrinkwrap": null, "_spec": "postcss-filter-plugins@https://registry.npmjs.org/postcss-filter-plugins/-/postcss-filter-plugins-2.0.0.tgz", "_where": "/Users/nw/flint/packages/flint", "author": { "email": "beneb.info@gmail.com", "name": "Ben Briggs", "url": "http://beneb.info" }, "bugs": { "url": "https://github.com/postcss/postcss-filter-plugins/issues" }, "dependencies": { "postcss": "^5.0.4", "uniqid": "^1.0.0" }, "description": "Exclude/warn on duplicated PostCSS plugins.", "devDependencies": { "babel": "^5.8.23", "babel-tape-runner": "^1.2.0", "postcss-minify-font-weight": "^1.0.1", "tap-spec": "^4.1.0", "tape": "^4.2.0" }, "files": [ "LICENSE-MIT", "dist" ], "homepage": "https://github.com/postcss/postcss-filter-plugins", "keywords": [ "css", "postcss", "postcss-plugin" ], "license": "MIT", "main": "dist/index.js", "name": "postcss-filter-plugins", "optionalDependencies": {}, "readme": "# [postcss][postcss]-filter-plugins [![Build Status](https://travis-ci.org/postcss/postcss-filter-plugins.svg?branch=master)][ci]\n\n> Exclude/warn on duplicated PostCSS plugins.\n\n## Install\n\nWith [npm](https://npmjs.org/package/postcss-filter-plugins) do:\n\n```console\n$ npm install postcss-filter-plugins --save\n```\n\n## Example\n\nNote that this plugin does not actually transform your CSS; instead, it ensures\nthat plugins in the PostCSS instance are not duplicated. It is intended to be\nused by plugin packs such as [cssnano] or [cssnext].\n\n```js\nvar counter = postcss.plugin('counter', function () {\n return function (css) {\n css.eachDecl('foo', function (decl) {\n let value = parseInt(decl.value, 10);\n value += 1;\n decl.value = String(value);\n });\n }\n});\n\nvar css = 'h1 { foo: 1 }';\nvar out = postcss([\n filter(),\n counter(),\n counter()\n]).process(css).css;\n\nconsole.log(out);\n// => h1 { foo: 2 }\n// Note that you will get a PostCSS warning in the message registry\n```\n\n## API\n\n### filterPlugins([options])\n\n#### options\n\n##### direction\n\nType: `string`\nDefault: `'both'`\n\nPass `'forward'`, `'backward'`, or `'both'` to customise the direction in which the\nplugin will look in the plugins array. See the [tests] for examples on how this\nworks.\n\n```js\npostcss([ filter({\n direction: 'forward'\n}) ]).process(css).css);\n```\n\n##### exclude\n\nType: `array`\nDefault: `[] (empty)`\n\nPlugins that should be excluded from the filter. Pass an array of plugin names.\n\n```js\npostcss([ filter({\n exclude: ['postcss-cssstats']\n}) ]).process(css).css);\n```\n\n##### silent\n\nType: `boolean`\nDefault: `false`\n\nSet this to true to disable the plugin from emitting any PostCSS warnings.\n\n```js\npostcss([ filter({\n silent: true\n}) ]).process(css).css);\n```\n\n##### template\n\nType: `function`\nDefault: `format function`\n\nThis function will be passed each PostCSS plugin object. You are expected to\nreturn a string from each call, which is then used to warn the user about her\nduplicated plugins.\n\n```js\npostcss([ filter({\n template: function (plugin) {\n return 'Duplicate plugin found: ' + plugin.postcssPlugin;\n }\n}) ]).process(css).css);\n```\n\n## Usage\n\nSee the [PostCSS documentation](https://github.com/postcss/postcss#usage) for\nexamples for your environment.\n\n## Contributing\n\nPull requests are welcome. If you add functionality, then please add unit tests\nto cover it.\n\n## License\n\nMIT © [Ben Briggs](http://beneb.info)\n\n[ci]: https://travis-ci.org/postcss/postcss-filter-plugins\n[cssnano]: http://cssnano.co\n[cssnext]: http://cssnext.io\n[postcss]: https://github.com/postcss/postcss\n[tests]: src/__tests__\n", "readmeFilename": "README.md", "repository": { "type": "git", "url": "git+https://github.com/postcss/postcss-filter-plugins.git" }, "scripts": { "prepublish": "babel src --out-dir dist --ignore /__tests__/", "test": "npm run test-unformatted | tap-spec", "test-unformatted": "babel-tape-runner \"src/**/__tests__/*.js\"" }, "version": "2.0.0" }