https://github.com/ericmorand/css-comment-rebase
https://github.com/ericmorand/css-comment-rebase
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ericmorand/css-comment-rebase
- Owner: ericmorand
- License: apache-2.0
- Created: 2017-04-02T14:50:39.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-02T15:54:28.000Z (over 9 years ago)
- Last Synced: 2025-09-07T05:34:35.795Z (10 months ago)
- Language: JavaScript
- Size: 9.77 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# css-comment-rebase
[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage percentage][coveralls-image]][coveralls-url]
Rebase your CSS assets based on node-sass source comments.
## Installation
```bash
npm install css-comment-rebase
```
## Example
From:
``` css
/* line 2, /path/to/the/scss/source/foo.scss */
.foo {
background: url(./foo.png);
}
```
To:
``` css
/* line 2, /path/to/the/scss/source/foo.scss */
.foo {
background: url(/path/to/the/scss/source/foo.png);
}
```
## API
`let Rebaser = require('css-comment-rebase')`
### rebaser = new Rebaser(opts={})
Return an object transform stream `rebaser` that expects entry filenames.
Optionally pass in some opts:
* opts.base:
The path the assets should be rebased _relatively_ to. Defaults to `null`.
## Events
In addition to the usual events emitted by node.js streams, css-comment-rebase emits the following events:
### rebaser.on('rebase', function(file) {})
Every time an asset is rebased, this event fires with the rebased path.
## Contributing
* Fork the main repository
* Code
* Implement tests using [node-tap](https://github.com/tapjs/node-tap)
* Issue a pull request keeping in mind that all pull requests must reference an issue in the issue queue
## License
Apache-2.0 © [Eric MORAND]()
[npm-image]: https://badge.fury.io/js/css-comment-rebase.svg
[npm-url]: https://npmjs.org/package/css-comment-rebase
[travis-image]: https://travis-ci.org/ericmorand/css-comment-rebase.svg?branch=master
[travis-url]: https://travis-ci.org/ericmorand/css-comment-rebase
[daviddm-image]: https://david-dm.org/ericmorand/css-comment-rebase.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/ericmorand/css-comment-rebase
[coveralls-image]: https://coveralls.io/repos/github/ericmorand/css-comment-rebase/badge.svg
[coveralls-url]: https://coveralls.io/github/ericmorand/css-comment-rebase