UNPKG

akb-cli

Version:

akb cli

27 lines (22 loc) 502 B
/** * @file 文件操作 * @author panyuqi(panyuqi@baidu.com) */ 'use strict'; const Promise = require('bluebird'); const fs = Promise.promisifyAll(require('fs-extra')); /** * 检查目标路径文件是否存在 * * @param {string} path 文件路径 * @return {Promise} */ fs.existsAsync = function (path) { return fs.openAsync(path, 'r') .then(function () { return true; }).catch(function () { return false; }); }; module.exports = fs;