根据git记录生成文件的头部信息(前提是该项目有git仓库)
/*
@ Description: This is a discription
@ Author: xxx@xxxx.com
@ CreatedTime: 2018-03-07 15:43:56
@ LastEditor: yyy@yyyy.com
@ LastEditTime: 2019-01-10 11:37:17
*/
npm i generatecomment
在项目根目录下创建comment.js文件,复制以下内容到文件中
const path = require('path');
const comment = require("generatecomment");
comment({
// 表示当前目录下test文件夹下的所有的js文件添加注释
filePath: path.resolve(__dirname, "./test/"),
fileSuffix: "js"
})
node comment.js