We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.spawnSafeSync = void 0; const cross_spawn_1 = require("cross-spawn"); const defaultOptions = { logStdErrOnError: true, throwOnError: true, }; const spawnSafeSync = (command, args, options) => { const mergedOptions = Object.assign({}, defaultOptions, options); const result = cross_spawn_1.sync(command, args, options); if (result.error || result.status !== 0) { if (mergedOptions.logStdErrOnError) { if (result.stderr) { console.error(result.stderr.toString()); } else if (result.error) { console.error(result.error); } } if (mergedOptions.throwOnError) { throw result; } } return result; }; exports.spawnSafeSync = spawnSafeSync;
throw result;
The text was updated successfully, but these errors were encountered:
var http = require("http");
http.createServer(function (request, response) { // Send the HTTP header // HTTP Status: 200 : OK // Content Type: text/plain response.writeHead(200, {'Content-Type': 'text/plain'});
// Send the response body as "Hello World" response.end('Hello World\n');
}).listen(8081);
// Console will print the message console.log('Server running at http://127.0.0.1:8081/'); console.error('This is on STDERR');
Sorry, something went wrong.
No branches or pull requests
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.spawnSafeSync = void 0;
const cross_spawn_1 = require("cross-spawn");
const defaultOptions = {
logStdErrOnError: true,
throwOnError: true,
};
const spawnSafeSync = (command, args, options) => {
const mergedOptions = Object.assign({}, defaultOptions, options);
const result = cross_spawn_1.sync(command, args, options);
if (result.error || result.status !== 0) {
if (mergedOptions.logStdErrOnError) {
if (result.stderr) {
console.error(result.stderr.toString());
}
else if (result.error) {
console.error(result.error);
}
}
if (mergedOptions.throwOnError) {
throw result;
}
}
return result;
};
exports.spawnSafeSync = spawnSafeSync;
The text was updated successfully, but these errors were encountered: