0

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.

HaoZeke
  • 674
  • 9
  • 19

2 Answers2

1

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

Jake Rayson
  • 921
  • 7
  • 20
1

You can print out the object contents by using JSON.stringify() to wrap the files and ms like this JSON.stringify(files,null,3) where 3 is the depth number of the object

H.Houssein
  • 23
  • 4