# postcss-comment

> Allow postcss to support inline comments

Latest version **2.0.0** (published 2018-03-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install postcss-comment
pnpm add postcss-comment
yarn add postcss-comment
bun add postcss-comment
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2018-03-05 |
| First published | 2015-11-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 17.9 KB |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 22 |
| Author | zoubin |
| Maintainers | zoubin |
| Keywords | postcss, inline, comment |

## Links

- npm: https://www.npmjs.com/package/postcss-comment
- Repository: https://github.com/zoubin/postcss-comment
- Homepage: https://github.com/zoubin/postcss-comment#readme
- Issues: https://github.com/zoubin/postcss-comment/issues
- npm.io page: https://npm.io/package/postcss-comment

## Dependencies (1)

- [postcss](https://npm.io/package/postcss.md) ^6.0.0

## Recent versions

- 2.0.0 (latest) — 2018-03-05
- 1.0.3 — 2016-01-27
- 1.0.2 — 2015-11-19
- 1.0.1 — 2015-11-19
- 0.1.2 — 2015-11-05
- 0.1.1 — 2015-11-04

## README

# postcss-comment
[![version](https://img.shields.io/npm/v/postcss-comment.svg)](https://www.npmjs.org/package/postcss-comment)
[![status](https://travis-ci.org/zoubin/postcss-comment.svg?branch=master)](https://travis-ci.org/zoubin/postcss-comment)
[![dependencies](https://david-dm.org/zoubin/postcss-comment.svg)](https://david-dm.org/zoubin/postcss-comment)
[![devDependencies](https://david-dm.org/zoubin/postcss-comment/dev-status.svg)](https://david-dm.org/zoubin/postcss-comment#info=devDependencies)

Allow postcss to support inline comments.

## Usage

```bash
npm i --save-dev postcss postcss-comment

```

### As parser

```javascript
var postcss = require('postcss')
var parser = 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')

var file = __dirname + '/inline.css'

postcss()
  .process(
    fs.readFileSync(file, 'utf8'),
    { from: file }
  )
  .then(function (result) {
    console.log(result.css)
  })

```

Or:
```javascript
var postcss = require('postcss-comment/hookRequire')

var fs = require('fs')

var file = __dirname + '/inline.css'

postcss()
  .process(
    fs.readFileSync(file, 'utf8'),
    { from: file }
  )
  .then(function (result) {
    console.log(result.css)
  })

```


## Example

inline.css:
```css
/*
 * comments//
 * //comments
 */
// comments
//* comments*/
.inline-comment { /// comments
  // com//ments
  color: red; // comments
} // /*comments
//*/ comments

```

outputs:
```css
/*
 * comments//
 * //comments
 */
/* comments */
/** comments*\/ */
.inline-comment { /*\/ comments */
  /* com//ments */
  color: red; /* comments */
} /* /*comments */
/**\/ comments */

```

---
_Source: https://npm.io/package/postcss-comment · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
