postcss-comment
Advanced tools
Comparing version
@@ -1,9 +0,2 @@ | ||
var Parser = require('postcss/lib/parser') | ||
var tokenizer = require('./lib/tokenize') | ||
exports.parse = require('./lib/parse') | ||
Parser.prototype.tokenize = function () { | ||
this.tokens = tokenizer(this.input) | ||
} | ||
module.exports = require('postcss') | ||
@@ -228,12 +228,7 @@ var SINGLE_QUOTE = 39; // `'' | ||
nextLine = line; | ||
nextOffset = offset; | ||
tokens.push(['comment', content, | ||
line, pos - offset, | ||
nextLine, next - nextOffset | ||
line, next - offset | ||
]); | ||
offset = nextOffset; | ||
line = nextLine; | ||
pos = next; | ||
@@ -240,0 +235,0 @@ |
{ | ||
"name": "postcss-comment", | ||
"version": "0.1.2", | ||
"version": "1.0.1", | ||
"description": "Allow postcss to support inline comments", | ||
@@ -24,4 +24,3 @@ "main": "index.js", | ||
"homepage": "https://github.com/zoubin/postcss-comment#readme", | ||
"dependencies": {}, | ||
"peerDependencies": { | ||
"dependencies": { | ||
"postcss": "^5.0.10" | ||
@@ -28,0 +27,0 @@ }, |
# postcss-comment | ||
Allow postcss to support inline comments. | ||
[](https://www.npmjs.org/package/postcss-comment) | ||
[](https://www.npmjs.org/package/postcss-comment) | ||
[](https://travis-ci.org/zoubin/postcss-comment) | ||
[](https://david-dm.org/zoubin/postcss-comment) | ||
[](https://david-dm.org/zoubin/postcss-comment#info=devDependencies) | ||
## Usage | ||
```bash | ||
npm i --save postcss postcss-comment | ||
npm i --save-dev postcss postcss-comment | ||
``` | ||
### As parser | ||
```javascript | ||
require('postcss-comment') | ||
var postcss = require('postcss') | ||
var parser = require('postcss-comment') | ||
// or | ||
// var postcss = require('postcss-comment') | ||
var fs = require('fs') | ||
var file = __dirname + '/inline.css' | ||
postcss() | ||
.process( | ||
fs.readFileSync(file, 'utf8'), | ||
{ from: file, parser: parser } | ||
) | ||
.then(function (result) { | ||
console.log(result.css) | ||
}) | ||
``` | ||
### Hook require | ||
```javascript | ||
require('postcss-comment/hookRequire') | ||
var postcss = require('postcss') | ||
var fs = require('fs') | ||
@@ -33,2 +60,4 @@ | ||
## Example | ||
inline.css: | ||
@@ -35,0 +64,0 @@ ```css |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
13996
26.01%11
83.33%249
7.33%0
-100%93
45.31%+ Added