voorhoede / fastatic

Speed up your static site with one command
MIT License
21 stars 3 forks source link

Output result as data #92

Closed petergoes closed 8 years ago

petergoes commented 8 years ago

The module outputs an object to consuming modules so own reporters can be written. The CLI version should als use this data instead of the parser-stats module. However, to keep this PR small. That is a done in its own PR (not started as of the time of this writing)

To test this PR, replace the current .then in bin/fastatic with:

.then(output => {
    console.log('src:')
    Object.keys(output.fileSize.src).map(key => {
        console.log(' ', key, filesize(output.fileSize.src[key]))
    })
    console.log('dest:')
    Object.keys(output.fileSize.dest).map(key => {
        console.log(' ', key, filesize(output.fileSize.dest[key]))
    })
    console.log('output:');
    console.log(output);
})

closes #70 (and supersedes #75)

petergoes commented 8 years ago

@jbmoelker I split the module up and return a new object as discussed