sqlFormatter
sql-formatter - npm (npmjs.com)
const sqlFormatter = require('@/utils/sqlFormatter') let sql = `select count(1) as cnt from t_user where id < 7`; // 格式化 // let sqlF = sqlFormatter.format(sql); let sqlF = sqlFormatter.format(sql, { language:'mysql', }); /** * indent: " ", * uppercase:false, * linesBetweenQueries: 2 */ console.log(sqlF)
增加样式
还没有评论,来说两句吧...