{
"rules": {
"comma-dangle": ["error", "never"],
"arrow-body-style": ["warn", "always"],
"no-const-assign": ["error"]
},
"parserOptions": {
"ecmaVersion": 6
}
}
const fs = require( 'fs' );
const path = require( 'path' );
const child_process = require( 'child_process' );
for( let arg of process.argv.splice( 2 ) ) {
let pathName = path.join( process.cwd(),arg );
if( isFile( path.join( process.cwd(),arg ) ) ) {
child_process.exec( `./node_modules/js-beautify/js/bin/js-beautify.js -P -E -j -a ${pathName} -r` , function( error, msg, stderr ) {
console.log( msg.replace('\\\\n','') );
} );
} else {
read_dir( pathName );
}
}
function read_dir( dir ){
let files = fs.readdirSync( dir );
for( let file of files ) {
let pathName = path.join( dir,file );
if( isFile( pathName ) ) {
child_process.exec( `./node_modules/js-beautify/js/bin/js-beautify.js -P -E -j -a ${pathName} -r` , function( error, msg, stderr ) {
console.log( msg.replace( '\\\\n','') );
} );
} else {
read_dir( pathName );
}
}
}
function isFile( path ){
return exists( path ) && fs.statSync( path ).isFile();
}
function exists( path ){
return fs.existsSync( path ) || path.existsSync( path );
}
{
"name": "demo",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"lint": "./node_modules/.bin/eslint routes runtime utils libs --quiet",
"lint-fix": "./node_modules/.bin/eslint routes runtime utils libs --quiet --fix",
"js-beautify": "node --harmony --use_strict ./bin/beatufyjs.js libs middlewares index.js "
},
"author": "kelvv",
"license": "ISC",
"config": {
"pre-git": {
"commit-msg": "",
"pre-commit": [
"npm run lint-fix",
"npm run js-beautify",
"git add ."
],
"pre-push": [],
"post-commit": [],
"post-checkout": [],
"post-merge": []
}
},
"devDependencies": {
"eslint": "^2.12.0",
"js-beautify": "^1.6.3",
"pre-git": "^3.9.1"
}
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有