pon-task-fmtjson
Pon task to format json files
Installation
$ npm install pon-task-fmtjson --save
Usage
'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()
Signatures
define(patterns, options) -> function
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 |
License
This software is released under the Apache-2.0 License.