NineSec Team Shell
Server IP : 92.205.26.207  /  Your IP : 216.73.216.16
Web Server : Apache
System : Linux 207.26.205.92.host.secureserver.net 4.18.0-553.60.1.el8_10.x86_64 #1 SMP Thu Jul 10 04:01:16 EDT 2025 x86_64
User : zikryat ( 1002)
PHP Version : 8.3.23
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home/zikryat/public_html/node_modules/mjml-cli/lib/helpers/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/zikryat/public_html/node_modules/mjml-cli/lib/helpers/promesify.js
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.readStdin = exports.read = exports.write = undefined;

var _fs = require('fs');

var _fs2 = _interopRequireDefault(_fs);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }

var stdinToBuffer = function stdinToBuffer(stream, done) {
  var buffer = '';

  stream.on('data', function (chunck) {
    buffer += chunck;
  });

  stream.on('end', function () {
    done(null, buffer);
  });
};

var promisify = function promisify(fn) {
  return function () {
    for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    return new Promise(function (resolve, reject) {
      return fn.apply(undefined, _toConsumableArray(args.concat(function (err) {
        for (var _len2 = arguments.length, data = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
          data[_key2 - 1] = arguments[_key2];
        }

        return err ? reject(err) : resolve.apply(undefined, data);
      })));
    });
  };
};

var write = exports.write = promisify(_fs2.default.writeFile);
var read = exports.read = promisify(_fs2.default.readFile);
var readStdin = exports.readStdin = promisify(stdinToBuffer);

NineSec Team - 2022