Pon task to format json files
$ npm install pon-task-fmtjson --save
'use strict'
const pon = require('pon')
const fmtjson = require('pon-task-fmtjson')
async function tryExample () {
const run = pon({
'format:json': fmtjson(['src/**/*.json'], {
sort: true,
indent: 2
})
})
run('format:*')
}
tryExample()
Define task
Param | type | Description |
---|---|---|
patterns | string|string[] | Target filename patterns |
options | Object | Optional settings |
options.sort | boolean | Should sort params |
options.indent | number | JSON indent |
This software is released under the Apache-2.0 License.