# 2019.05.31
[工具] 一个在线表格转换工具,可以把表格转换成 Markdown、CSV、JSON、XML 等格式:https://tableconvert.com/?output=text&import=example (opens new window)
[类库] less-plugin-npm-import 是允许从 NPM 包中,导入 Less 文件:https://github.com/less/less-plugin-npm-import (opens new window)
[类库] temp-dir 是用于取系统临时目录的工具,用于解决 os.temdir() 符号链接的问题:https://github.com/sindresorhus/temp-dir (opens new window)
[类库] Gulp-file 是可以在 Gulp 中,用 if 条件来进行后续处理;比如当前环境是生产时,才进行 uglify 等:https://github.com/robrich/gulp-if (opens new window)
# 配图 - 表格转换工具
# 配图 - Gulp-file
# 示例 - Gulp-file
var gulpif = require('gulp-if');
var uglify = require('gulp-uglify');
var condition = true; // TODO: add business logic
gulp.task('task', function() {
gulp.src('./src/*.js')
.pipe(gulpif(condition, uglify()))
.pipe(gulp.dest('./dist/'));
});
# 示例 - less-plugin-npm-import
@import "npm://packagename/path/to/file.less";
# 示例 - temp-dir
const tempDirectory = require('temp-dir');
console.log(tempDirectory);
//=> '/private/var/folders/3x/jf5977fn79jbglr7rk0tq4d00000gn/T'
console.log(require('os').tmpdir());
//=> '/var/folders/3x/jf5977fn79jbglr7rk0tq4d00000gn/T' // <= Symlink