b374k
m1n1 1.01
Apache/2.4.41 (Ubuntu)
Linux vmi616275.contaboserver.net 5.4.0-84-generic #94-Ubuntu SMP Thu Aug 26 20:27:37 UTC 2021 x86_64
uid=33(www-data) gid=33(www-data) groups=33(www-data)
server ip : 62.171.164.128 | your ip : 127.0.0.1
safemode OFF
 >  / home / dev2.destoffenstraat.com / dev / tools / grunt / tools /
Filename/home/dev2.destoffenstraat.com/dev/tools/grunt/tools/fs-tools.js
Size1.3 kb
Permissionrw-r--r--
Ownerroot : root
Create time17-Aug-2025 10:26
Last modified28-Jan-2025 06:45
Last accessed21-Aug-2025 02:08
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
'use strict';

var fs = require('fs'),
glob = require('glob'),
nl = (function () {
if (process.platform === 'win32') {
return '\r\n';
}

return '\n';
})();

module.exports = {
getData: function (filePath) {
return this.parseToReadData(fs.readFileSync(filePath));
},
write: function (file, data) {
fs.writeFileSync(file, this.parseToWriteData(data));
console.log('The file was saved!');
},

read: function (filePath) {
console.log('Collect data from ' + filePath + ': Start!');

return glob.sync(filePath, {
symlinks: true
});
},

arrayRead: function (pathArr, callback) {
var len = pathArr.length,
data = [],
i = 0;

for (; i < len; i++) {
data = data.concat(this.read(pathArr[i]));
console.log('Collect data from ' + pathArr[i] + ': Finish!');
}
callback(data);
},

parseToReadData: function (data) {
var result = data.toString().split(nl);

result.pop();

return result;
},

parseToWriteData: function (data) {
data = data.join(nl) + nl;

return data;
}
};