Nautilus: Pelagic Mollusc

    fela-statistics

    12.2.0 • 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.

    Install

    npm i fela-statistics

    DownloadsWeekly Downloads

    82

    Version

    12.2.0

    License

    MIT

    Unpacked Size

    152 kB

    Total Files

    6

    Last publish

    Collaborators

    • rofrischmann
    • txhawks