2.0.2 • Published 4 months ago

metalsmith-tracer v2.0.2

Weekly downloads
14
License
GPL-3.0-or-later
Repository
github
Last release
4 months ago

metalsmith-tracer

npm: version npm: downloads

Snyk: vulnerabilities codecov: coverage license

A tool to automatically trace and measure Metalsmith build time.

The Metalsmith build process has no progress output to indicate how many plugins have been processed and how many more are left. Build pipelines with a lot of plugins can take a long time to finish, and it's very difficult to know which plugins take the most time. This package is a wrapper around Metalsmith that outputs meaningful build progress.

Here is example console output when wrapped around the metalsmith/startbootstrap-clean-blog example:

------- Build process started -------

  4.7ms (unnamed)
 32.5ms (unnamed)
  2.3ms @metalsmith/collections
  0.4ms metalsmith.js
511.9ms @metalsmith/layouts
   1.8s @metalsmith/sass
  0.3ms metalsmith.js

   2.4s Total build time

Build finished

Installation

npm install --save metalsmith-tracer

JavaScript Usage

This plugin requires ES6 syntax.

metalsmith-tracer wraps the root metalsmith call:

import path from 'path';

import Metalsmith from 'metalsmith';
import tracer from 'metalsmith-tracer';

tracer(Metalsmith(path.resolve()), {
        // options here
    })
    .build((err) => {
        if (err) {
            throw err;
        }
    });

Options

log (optional)

Type: (...data: unknown[]) => void Default: console.log

The logger function.

Limitations

  • setImmediate()

    Plugins that use setImmediate() to call their done callback will not print their real name due to how metalsmith-tracer uses the call stack.

  • metalsmith-if

    Using metalsmith-if will mask the name of the plugin actually being used.

Changelog

Changelog

2.0.2

4 months ago

2.0.1

5 months ago

1.0.6

6 months ago

1.0.5

6 months ago

1.0.4

6 months ago

2.0.0

6 months ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

2 years ago

1.0.0

2 years ago

0.5.0

2 years ago

0.4.0

2 years ago

0.3.11

3 years ago

0.3.10

3 years ago

0.3.7

3 years ago

0.3.6

3 years ago

0.3.5

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.0

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago

0.0.1

4 years ago