2019-06-27 12:22:54 +08:00
|
|
|
const fs = require('fs');
|
2019-06-28 11:04:22 +08:00
|
|
|
const chalk = require('chalk');
|
2019-06-27 12:22:54 +08:00
|
|
|
const json = require('../src/RULES.js');
|
2019-07-11 10:55:13 +08:00
|
|
|
let content = `# 正则大全   
|
2019-07-10 23:15:51 +08:00
|
|
|
:whale:图形界面: https://any86.github.io/any-rule/\r\n
|
|
|
|
`;
|
|
|
|
|
2019-06-27 12:22:54 +08:00
|
|
|
json.forEach(({title, rule})=>{
|
|
|
|
content+= `\r\n## ${title}\r\n`;
|
2019-06-28 11:04:22 +08:00
|
|
|
content+= `\`\`\`javascript\r\n`;
|
|
|
|
content+= `${rule}\r\n\`\`\`\r\n`;
|
2019-06-27 12:22:54 +08:00
|
|
|
});
|
2019-06-28 11:04:22 +08:00
|
|
|
fs.writeFileSync('./README.md',content,'utf-8');
|
|
|
|
console.log(chalk.green('生成完毕'));
|