0.0.7 • Published 6 years ago

extract-classnames v0.0.7

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

extract-classnames

Node command line tool where you can extract css from html

input

<figure class="photo">
    <img class="photo__img" src="me.jpg">
    <figcaption class="photo__caption">
        <blockquote class="photo__quote">
        Look at me!
        </blockquote>
    </figcaption>
</figure>

output

.photo {

}
.photo__img {

}
.photo__caption {

}
.photo__quote {

}

Usage

npm install extract-classnames
npx excn --src ./test/index.html --dest ./test/index.css

global install

npm install extract-classnames -g
excn --src ./test/index.html --dest ./test/index.css

you can also execute the same function with the command extract-classnames

extract-classnames --src ./test/index.html --dest ./test/index.css

API

extract

const excn = require('extract-classnames');
const result = excn.extract(html);

extractByFile

const excn = require('extract-classnames');
excn.extractByFile('/path/to/filename').then((css) => {
  console.log(css);
});
0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago