page-id
v1.0.4
Published
generate page id
Downloads
8
Readme
page-id
Generating unique random ID
#安装: npm i -g page-id
#用法
文件中需要生成pageid的地方写上@@@pageid@@@
执行 page-id path --namespace name; 其中path为要替换的文件或者路径,支持glob, name为命名空间,可以为该命名生成独一无二的key,避免与别的仓库重复。
page-id --namespace name; 可以直接生成一个id
--namespace可不写,默认值为hf
#例如:
- page-id a.html --namespace hfmobile
- page-id '/*.js' --namespace hf 替换该目录下所有的js 注意:path代引号,为js处理glob,可以深度便利所有子文件夹。如果不带引号,则为node command line 解析glob,/*.js,只能命中一级目录。
- page-id 'web/**/*.html' --namespace hf 替换web目录下所有html
- page-id 'web/*.html' --namespace hf 仅替换web目录下一级的html,对web子目录忽略