Search code examples
jsonmetalsmith

Viewing the metalsmith pipeline JSON


Metalsmith has an inbuilt way of displaying the pipeline contents, namely by using a simple function like:

    function(files, ms, done) {
        console.log('Files: ');
        console.log(files);
        console.log();
        console.log('Metalsmith ');
        console.log(ms);
        done();
    }

Or with metalsmith-logger

logger(['title', 'tags', 'contents')

However in both cases I get the output as [object Object] and I require the full output. (i.e what I might get with JSON.stringify)

Even more so though, I wonder if there's any way to get a nicely formatted output of the pipe and contents after each transform, like one gets using gatsbyjs and graphQL.


Solution

  • Would metalsmith-debug-ui help? Nicely formatted React tool…