uawdijnntqw1x1x1
IP : 216.73.216.110
Hostname : 6.87.74.97.host.secureserver.net
Kernel : Linux 6.87.74.97.host.secureserver.net 4.18.0-553.83.1.el8_10.x86_64 #1 SMP Mon Nov 10 04:22:44 EST 2025 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
home
/
emeraadmin
/
.cpanel
/
..
/
public_html
/
.
/
node_modules
/
..
/
wp-includes
/
..
/
4d695
/
flagged-respawn.tar
/
/
package.json000064400000004721151676727050007056 0ustar00{ "_from": "flagged-respawn@^1.0.1", "_id": "flagged-respawn@1.0.1", "_inBundle": false, "_integrity": "sha512-lNaHNVymajmk0OJMBn8fVUAU1BtDeKIqKoVhk4xAALB57aALg6b4W0MfJ/cUE0g9YBXy5XhSlPIpYIJ7HaY/3Q==", "_location": "/flagged-respawn", "_phantomChildren": {}, "_requested": { "type": "range", "registry": true, "raw": "flagged-respawn@^1.0.1", "name": "flagged-respawn", "escapedName": "flagged-respawn", "rawSpec": "^1.0.1", "saveSpec": null, "fetchSpec": "^1.0.1" }, "_requiredBy": [ "/liftup" ], "_resolved": "https://registry.npmjs.org/flagged-respawn/-/flagged-respawn-1.0.1.tgz", "_shasum": "e7de6f1279ddd9ca9aac8a5971d618606b3aab41", "_spec": "flagged-respawn@^1.0.1", "_where": "C:\\xampp\\htdocs\\emeraltd\\node_modules\\liftup", "author": { "name": "Gulp Team", "email": "team@gulpjs.com", "url": "http://gulpjs.com/" }, "bugs": { "url": "https://github.com/gulpjs/flagged-respawn/issues" }, "bundleDependencies": false, "contributors": [ { "name": "Takayuki Sato", "email": "sttk.xslet@gmail.com" }, { "name": "Bertrand Marron", "email": "bertrand.marron@ionisx.com" }, { "name": "Tyler Kellen", "email": "tyler@sleekcode.net" }, { "name": "Blaine Bublitz", "email": "blaine.bublitz@gmail.com" } ], "dependencies": {}, "deprecated": false, "description": "A tool for respawning node binaries when special flags are present.", "devDependencies": { "eslint": "^2.13.0", "eslint-config-gulp": "^3.0.1", "expect": "^1.20.2", "istanbul": "^0.4.3", "istanbul-coveralls": "^1.0.3", "mocha": "^3.5.3", "nyc": "^11.3.0", "v8flags": "^3.0.1" }, "engines": { "node": ">= 0.10" }, "files": [ "index.js", "lib/", "LICENSE" ], "homepage": "https://github.com/gulpjs/flagged-respawn#readme", "keywords": [ "respawn", "flags" ], "license": "MIT", "main": "index.js", "name": "flagged-respawn", "repository": { "type": "git", "url": "git+https://github.com/gulpjs/flagged-respawn.git" }, "scripts": { "cover": "nyc --reporter=lcov --reporter=text-summary npm test", "coveralls": "npm run cover && istanbul-coveralls", "lint": "eslint .", "nospawn": "node test/bin/respawner test", "pretest": "npm run lint", "respawn": "node test/bin/respawner --harmony test", "test": "mocha --async-only" }, "version": "1.0.1" } lib/respawn.js000064400000000624151676727050007351 0ustar00var spawn = require('child_process').spawn; module.exports = function(argv) { var child = spawn(argv[0], argv.slice(1), { stdio: 'inherit' }); child.on('exit', function(code, signal) { process.on('exit', function() { /* istanbul ignore if */ if (signal) { process.kill(process.pid, signal); } else { process.exit(code); } }); }); return child; }; lib/is-v8flags.js000064400000000505151676727050007653 0ustar00function isV8flags(flag, v8flags) { return v8flags.indexOf(replaceSeparatorsFromDashesToUnderscores(flag)) >= 0; } function replaceSeparatorsFromDashesToUnderscores(flag) { var arr = /^(-+)(.*)$/.exec(flag); if (!arr) { return flag; } return arr[1] + arr[2].replace(/\-/g, '_'); } module.exports = isV8flags; lib/remover.js000064400000000461151676727050007350 0ustar00var isV8flags = require('./is-v8flags'); module.exports = function(flags, argv) { var args = argv.slice(0, 1); for (var i = 1, n = argv.length; i < n; i++) { var arg = argv[i]; var flag = arg.split('=')[0]; if (!isV8flags(flag, flags)) { args.push(arg); } } return args; }; lib/reorder.js000064400000000566151676727050007341 0ustar00var isV8flags = require('./is-v8flags'); module.exports = function(flags, argv) { if (!argv) { argv = process.argv; } var args = [argv[1]]; argv.slice(2).forEach(function(arg) { var flag = arg.split('=')[0]; if (isV8flags(flag, flags)) { args.unshift(arg); } else { args.push(arg); } }); args.unshift(argv[0]); return args; }; LICENSE000064400000002242151676727050005571 0ustar00The MIT License (MIT) Copyright (c) 2014-2018 Tyler Kellen <tyler@sleekcode.net>, Blaine Bublitz <blaine.bublitz@gmail.com>, and Eric Schoffstall <yo@contra.io> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. index.js000064400000002362151676727050006234 0ustar00var reorder = require('./lib/reorder'); var respawn = require('./lib/respawn'); var remover = require('./lib/remover'); var FORBID_RESPAWNING_FLAG = '--no-respawning'; module.exports = function(flags, argv, forcedFlags, execute) { if (!flags) { throw new Error('You must specify flags to respawn with.'); } if (!argv) { throw new Error('You must specify an argv array.'); } if (typeof forcedFlags === 'function') { execute = forcedFlags; forcedFlags = []; } if (typeof forcedFlags === 'string') { forcedFlags = [forcedFlags]; } if (!Array.isArray(forcedFlags)) { forcedFlags = []; } var index = argv.indexOf(FORBID_RESPAWNING_FLAG); if (index >= 0) { argv = argv.slice(0, index).concat(argv.slice(index + 1)); argv = remover(flags, argv); execute(true, process, argv); return; } var proc = process; var reordered = reorder(flags, argv); var ready = JSON.stringify(argv) === JSON.stringify(reordered); if (forcedFlags.length) { reordered = reordered.slice(0, 1) .concat(forcedFlags) .concat(reordered.slice(1)); ready = false; } if (!ready) { reordered.push(FORBID_RESPAWNING_FLAG); proc = respawn(reordered); } execute(ready, proc, reordered); }; README.md000064400000012176151676727050006052 0ustar00<p align="center"> <a href="http://gulpjs.com"> <img height="257" width="114" src="https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png"> </a> </p> # flagged-respawn [![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Travis Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url] A tool for respawning node binaries when special flags are present. ## What is it? Say you wrote a command line tool that runs arbitrary javascript (e.g. task runner, test framework, etc). For the sake of discussion, let's pretend it's a testing harness you've named `testify`. Everything is going splendidly until one day you decide to test some code that relies on a feature behind a v8 flag in node (`--harmony`, for example). Without much thought, you run `testify --harmony spec tests.js`. It doesn't work. After digging around for a bit, you realize this produces a [`process.argv`](http://nodejs.org/docs/latest/api/process.html#process_process_argv) of: `['node', '/usr/local/bin/test', '--harmony', 'spec', 'tests.js']` Crap. The `--harmony` flag is in the wrong place! It should be applied to the **node** command, not our binary. What we actually wanted was this: `['node', '--harmony', '/usr/local/bin/test', 'spec', 'tests.js']` Flagged-respawn fixes this problem and handles all the edge cases respawning creates, such as: - Providing a method to determine if a respawn is needed. - Piping stderr/stdout from the child into the parent. - Making the parent process exit with the same code as the child. - If the child is killed, making the parent exit with the same signal. To see it in action, clone this repository and run `npm install` / `npm run respawn` / `npm run nospawn`. ## Sample Usage ```js #!/usr/bin/env node const flaggedRespawn = require('flagged-respawn'); // get a list of all possible v8 flags for the running version of node const v8flags = require('v8flags').fetch(); flaggedRespawn(v8flags, process.argv, function (ready, child) { if (ready) { console.log('Running!'); // your cli code here } else { console.log('Special flags found, respawning.'); } if (process.pid !== child.pid) { console.log('Respawned to PID:', child.pid); } }); ``` ## API ### <u>flaggedRespawn(flags, argv, [ forcedFlags, ] callback) : Void</u> Respawns the script itself when *argv* has special flag contained in *flags* and/or *forcedFlags* is not empty. Because members of *flags* and *forcedFlags* are passed to `node` command, each of them needs to be a node flag or a V8 flag. #### Forbid respawning If `--no-respawning` flag is given in *argv*, this function does not respawned even if *argv* contains members of flags or *forcedFlags* is not empty. (This flag is also used internally to prevent from respawning more than once). #### Parameter: | Parameter | Type | Description | |:--------------|:------:|:----------------------------------------------------| | *flags* | Array | An array of node flags and V8 flags which are available when present in *argv*. | | *argv* | Array | Command line arguments to respawn. | | *forcedFlags* | Array or String | An array of node flags or a string of a single flag and V8 flags for respawning forcely. | | *callback* | function | A called function when not respawning or after respawned. | * **<u><i>callback</i>(ready, proc, argv) : Void</u>** *callback* function is called both when respawned or not, and it can be distinguished by callback's argument: *ready*. (*ready* indicates whether a process spawned its child process (false) or not (true), but it does not indicate whether a process is a spawned child process or not. *ready* for a spawned child process is true.) *argv* is an array of command line arguments which is respawned (when *ready* is false) or is passed current process except flags within *flags* and `--no-respawning` (when *ready* is true). **Parameter:** | Parameter | Type | Description | |:----------|:-------:|:--------------------------| | *ready* | boolean | True, if not respawning and is ready to execute main function. | | *proc* | object | Child process object if respawned, otherwise current process object. | | *argv* | Array | An array of command line arguments. | ## License MIT [downloads-image]: http://img.shields.io/npm/dm/flagged-respawn.svg [npm-url]: https://www.npmjs.com/package/flagged-respawn [npm-image]: http://img.shields.io/npm/v/flagged-respawn.svg [travis-url]: https://travis-ci.org/gulpjs/flagged-respawn [travis-image]: http://img.shields.io/travis/gulpjs/flagged-respawn.svg?label=travis-ci [appveyor-url]: https://ci.appveyor.com/project/gulpjs/flagged-respawn [appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/flagged-respawn.svg?label=appveyor [coveralls-url]: https://coveralls.io/r/gulpjs/flagged-respawn [coveralls-image]: http://img.shields.io/coveralls/gulpjs/flagged-respawn/master.svg [gitter-url]: https://gitter.im/gulpjs/gulp [gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg
/home/emeraadmin/.cpanel/../public_html/./node_modules/../wp-includes/../4d695/flagged-respawn.tar