https://github.com/zephraph/postcss-process-comments
Extract text from css comments
https://github.com/zephraph/postcss-process-comments
Last synced: about 2 months ago
JSON representation
Extract text from css comments
- Host: GitHub
- URL: https://github.com/zephraph/postcss-process-comments
- Owner: zephraph
- License: mit
- Created: 2016-11-11T17:01:13.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-06-18T14:35:25.000Z (almost 8 years ago)
- Last Synced: 2025-02-04T13:23:04.973Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# postcss-process-comments [](https://travis-ci.org/zephraph/postcss-process-comments)
[](https://greenkeeper.io/)
A plugin to process text from css comments
## API
* options
* process [_function_] **Required**
- Method to process the comment matching _pattern_. Receives a postcss [comment node](http://api.postcss.org/Comment.html) as an argument.
* pattern [_regex_]
- Pattern to filter comments on for processing## Usage
```javascript
import processComment from 'postcss-process-comments';
import postcss from 'postcss';const process = ({ text }) => console.log(text);
// Prints all comments
postcss([ processComment({ process }) ]);// prints all comments starting with the test TEST
postcss([ processComment({ process, pattern: /^TEST/ })]);
```