fela-statistics

12.2.1 • Public • Published

fela-statistics

npm version npm downloads Bundlephobia

Statistic generation tool for Fela. It collects several information and metrics to better analyze your application CSS.
Right now, it provides the following information:

  • Class count
    • per media query
    • with/without pseudo class
  • Usage per class
  • CSS file size
    • in bytes, kbytes, bytes (gzipped) and kbytes (gzipped)
  • Reuse
    • Reuse ratio (total used classes vs. total unique classes)
  • total classes with pseudo classes
  • total classes inside media queries
  • total renders
  • total used classes

Installation

yarn add fela-statistics

You may alternatively use npm i --save fela-statistics.

Usage

Adding the statistics enhancer will add a new function to the renderer called getStatistics.
You may call it at any given time, to get the current statistics object.

import { createRenderer } from 'fela'
import statistics from 'fela-statistics'

const renderer = createRenderer({
  enhancers: [ statistics() ]
})

// rendering stuff

const stats = renderer.getStatistics()
console.log(stats)

Example

License

Fela is licensed under the MIT License.
Documentation is licensed under Creative Commons License.
Created with by @robinweser and all the great contributors.

Package Sidebar

Install

npm i fela-statistics

Weekly Downloads

63

Version

12.2.1

License

MIT

Unpacked Size

152 kB

Total Files

6

Last publish

Collaborators

  • rofrischmann
  • txhawks