Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
gulp-git-svn-version-filename
Advanced tools
此 gulp 插件用于在文件名中添加对应 Git/Svn 的版本号。
注意:gulpfile.js
文件所在目录需要是 Git/Svn 有效的版本仓库目录,并确保命令行中能正常运行 Git/Svn 命令。
安装模块
npm i gulp-git-svn-version-filename
var FileVer = require('gulp-git-svn-version-filename');
var fileVer = new FileVer({
type: 'svn', // 仓库类型 支持svn、git
cwd: process.cwd(), // 项目根目录
user: '', // 仓库账号名
pwd: '', // 仓库账号密码
cache: true, // 是否缓存已查询版本信息
formater: '{name}_{version}{ext}', // 文件名加版本号的规则(不提供目录结构修改)
});
pathObj. = Path.parse(path)
,并加入version
信息,this指向fileVer。{'/home/user/git/project/js/a.js': '34ae3'}
this.formater
规则给fullPath加上version信息file.path
加完版本后的回调方法配置中user、pwd参数目前只有SVN支持,Git仓库请走ssh方式
gulpfile.js 中
var FileVer = require('gulp-git-svn-version-filename');
var cacheObj = {};
var fileVer = new FileVer({
type: 'svn', // 仓库类型 支持svn、git
cache: cacheObj, // 指定缓存对象
cwd: process.cwd(), // 项目根目录
user: '', // 仓库账号名
pwd: '', // 仓库账号密码
});
gulp.task('addSvnVersion', function(){
return gulp.src(['./js/**/*.js', './css/**/*.css'])
.pipe(fileVer.setForTransform(function(oldPath, versionPath){
console.log(versionPath, fileVer.getCache());
})
.pipe(gulp.dest('./build'))
});
FAQs
文件名中追加svn/git的对应文件版本号,要求传入文件的父层在svn/git仓库中
The npm package gulp-git-svn-version-filename receives a total of 1 weekly downloads. As such, gulp-git-svn-version-filename popularity was classified as not popular.
We found that gulp-git-svn-version-filename demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.