14 lines
562 B
JavaScript
Raw Normal View History

2019-06-27 12:22:54 +08:00
const fs = require('fs');
const chalk = require('chalk');
2019-06-27 12:22:54 +08:00
const json = require('../src/RULES.js');
let content = `# 正则大全 ![](https://img.shields.io/badge/已收录-${json.length}条-4caf50.svg) ![](https://img.shields.io/badge/license-MIT-F44336.svg)
: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`;
content+= `\`\`\`javascript\r\n`;
content+= `${rule}\r\n\`\`\`\r\n`;
2019-06-27 12:22:54 +08:00
});
fs.writeFileSync('./README.md',content,'utf-8');
console.log(chalk.green('生成完毕'));