UNPKG

554 BJavaScriptView Raw
1(function() {
2 module.exports = function($) {
3 var fse, normalizePath, wrapList;
4 ({normalizePath, wrapList} = $.fn);
5 fse = require('fs-extra');
6
7 // return
8 return $.write_ = async function(source, data, option) {
9 var ref;
10 source = normalizePath(source);
11 if ((ref = $.type(data)) === 'array' || ref === 'object') {
12 data = $.parseString(data);
13 }
14 await fse.outputFile(source, data, option);
15 $.info('file', `wrote ${wrapList(source)}`);
16 return $; // return
17 };
18 };
19
20}).call(this);