Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sinsoku/clairvoyance

Clairvoyance provides a way to measure code coverage for CSS
https://github.com/sinsoku/clairvoyance

Last synced: 2 months ago
JSON representation

Clairvoyance provides a way to measure code coverage for CSS

Awesome Lists containing this project

README

        

# Clairvoyance - a css code coverage tool

[![npm version](https://badge.fury.io/js/clairvoyance.svg)](https://badge.fury.io/js/clairvoyance)
[![Build Status](https://travis-ci.org/sinsoku/clairvoyance.svg?branch=master)](https://travis-ci.org/sinsoku/clairvoyance)
[![codecov.io](https://codecov.io/github/sinsoku/clairvoyance/coverage.svg?branch=master)](https://codecov.io/github/sinsoku/clairvoyance?branch=master)
[![Inline docs](http://inch-ci.org/github/sinsoku/clairvoyance.svg?branch=master)](http://inch-ci.org/github/sinsoku/clairvoyance)

## Installation

Install with npm:

$ npm install -g clairvoyance

## Getting Started

Run as follow:

$ clairvoyance --css path/app.css --html path/index.html

And this will write a coverage file to `coverage/css-coverage.json`.

## Usage

```
Usage: clairvoyance [options]

Options:

-h, --help output usage information
-V, --version output the version number
--css specify css path
--html specify html path
-R, --reporter append the reporter
```

### -R, --reporter

The --reporter option allows you to append the reporter. For example, you append the [clairvoyance-html](https://github.com/sinsoku/clairvoyance-html) to generate a html report.

$ clairvoyance --css path/app.css --html path/index.html --reporter clairvoyance-html

Then, you will get a html report like below:

![](https://raw.github.com/sinsoku/clairvoyance-html/master/doc/images/index.png)

**source code view**:

![](https://raw.github.com/sinsoku/clairvoyance-html/master/doc/images/source.png)

## API

```js
var Clairvoyance = require("clairvoyance");

var parser = new Clairvoyance({css: "path/app.css", html: "path/index.html"});
parser.run(function(result) {
console.log(result);
// { "path/app.css": [null, null, 0, 0, 1, 1, 2, ...] }
});
```