From 6555fb80fdd8f6a5d201efadec3189d1244830a0 Mon Sep 17 00:00:00 2001 From: Nevena Bojovic Date: Tue, 1 Mar 2022 22:05:25 +0100 Subject: Izbrisala bin, obj i node-modules. --- .../node_modules/@npmcli/promise-spawn/LICENSE | 15 ----- .../node_modules/@npmcli/promise-spawn/README.md | 66 ------------------- .../node_modules/@npmcli/promise-spawn/index.js | 75 ---------------------- .../@npmcli/promise-spawn/package.json | 32 --------- 4 files changed, 188 deletions(-) delete mode 100644 sandbox/testAppNevena/Front/node_modules/@npmcli/promise-spawn/LICENSE delete mode 100644 sandbox/testAppNevena/Front/node_modules/@npmcli/promise-spawn/README.md delete mode 100644 sandbox/testAppNevena/Front/node_modules/@npmcli/promise-spawn/index.js delete mode 100644 sandbox/testAppNevena/Front/node_modules/@npmcli/promise-spawn/package.json (limited to 'sandbox/testAppNevena/Front/node_modules/@npmcli/promise-spawn') diff --git a/sandbox/testAppNevena/Front/node_modules/@npmcli/promise-spawn/LICENSE b/sandbox/testAppNevena/Front/node_modules/@npmcli/promise-spawn/LICENSE deleted file mode 100644 index 8f90f96f..00000000 --- a/sandbox/testAppNevena/Front/node_modules/@npmcli/promise-spawn/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) npm, Inc. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE NPM DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS. IN NO EVENT SHALL THE NPM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, -OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS -ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS -SOFTWARE. diff --git a/sandbox/testAppNevena/Front/node_modules/@npmcli/promise-spawn/README.md b/sandbox/testAppNevena/Front/node_modules/@npmcli/promise-spawn/README.md deleted file mode 100644 index b569948c..00000000 --- a/sandbox/testAppNevena/Front/node_modules/@npmcli/promise-spawn/README.md +++ /dev/null @@ -1,66 +0,0 @@ -# @npmcli/promise-spawn - -Spawn processes the way the npm cli likes to do. Give it some options, -it'll give you a Promise that resolves or rejects based on the results of -the execution. - -Note: When the current user is root, this will use -[`infer-owner`](http://npm.im/infer-owner) to find the owner of the current -working directory, and run with that effective uid/gid. Otherwise, it runs -as the current user always. (This helps prevent doing git checkouts and -such, and leaving root-owned files lying around in user-owned locations.) - -## USAGE - -```js -const promiseSpawn = require('@npmcli/promise-spawn') - -promiseSpawn('ls', [ '-laF', 'some/dir/*.js' ], { - cwd: '/tmp/some/path', // defaults to process.cwd() - stdioString: false, // stdout/stderr as strings rather than buffers - stdio: 'pipe', // any node spawn stdio arg is valid here - // any other arguments to node child_process.spawn can go here as well, - // but uid/gid will be ignored and set by infer-owner if relevant. -}, { - extra: 'things', - to: 'decorate', - the: 'result', -}).then(result => { - // {code === 0, signal === null, stdout, stderr, and all the extras} - console.log('ok!', result) -}).catch(er => { - // er has all the same properties as the result, set appropriately - console.error('failed!', er) -}) -``` - -## API - -### `promiseSpawn(cmd, args, opts, extra)` -> `Promise` - -Run the command, return a Promise that resolves/rejects based on the -process result. - -Result or error will be decorated with the properties in the `extra` -object. You can use this to attach some helpful info about _why_ the -command is being run, if it makes sense for your use case. - -If `stdio` is set to anything other than `'inherit'`, then the result/error -will be decorated with `stdout` and `stderr` values. If `stdioString` is -set to `true`, these will be strings. Otherwise they will be Buffer -objects. - -Returned promise is decorated with the `stdin` stream if the process is set -to pipe from `stdin`. Writing to this stream writes to the `stdin` of the -spawned process. - -#### Options - -- `stdioString` Boolean, default `false`. Return stdout/stderr output as - strings rather than buffers. -- `cwd` String, default `process.cwd()`. Current working directory for - running the script. Also the argument to `infer-owner` to determine - effective uid/gid when run as root on Unix systems. -- Any other options for `child_process.spawn` can be passed as well, but - note that `uid` and `gid` will be overridden by the owner of the cwd when - run as root on Unix systems, or `null` otherwise. diff --git a/sandbox/testAppNevena/Front/node_modules/@npmcli/promise-spawn/index.js b/sandbox/testAppNevena/Front/node_modules/@npmcli/promise-spawn/index.js deleted file mode 100644 index 6ad51b8e..00000000 --- a/sandbox/testAppNevena/Front/node_modules/@npmcli/promise-spawn/index.js +++ /dev/null @@ -1,75 +0,0 @@ -const {spawn} = require('child_process') - -const inferOwner = require('infer-owner') - -const isPipe = (stdio = 'pipe', fd) => - stdio === 'pipe' || stdio === null ? true - : Array.isArray(stdio) ? isPipe(stdio[fd], fd) - : false - -// 'extra' object is for decorating the error a bit more -const promiseSpawn = (cmd, args, opts, extra = {}) => { - const cwd = opts.cwd || process.cwd() - const isRoot = process.getuid && process.getuid() === 0 - const { uid, gid } = isRoot ? inferOwner.sync(cwd) : {} - return promiseSpawnUid(cmd, args, { - ...opts, - cwd, - uid, - gid - }, extra) -} - -const stdioResult = (stdout, stderr, {stdioString, stdio}) => - stdioString ? { - stdout: isPipe(stdio, 1) ? Buffer.concat(stdout).toString() : null, - stderr: isPipe(stdio, 2) ? Buffer.concat(stderr).toString() : null, - } - : { - stdout: isPipe(stdio, 1) ? Buffer.concat(stdout) : null, - stderr: isPipe(stdio, 2) ? Buffer.concat(stderr) : null, - } - -const promiseSpawnUid = (cmd, args, opts, extra) => { - let proc - const p = new Promise((res, rej) => { - proc = spawn(cmd, args, opts) - const stdout = [] - const stderr = [] - const reject = er => rej(Object.assign(er, { - cmd, - args, - ...stdioResult(stdout, stderr, opts), - ...extra, - })) - proc.on('error', reject) - if (proc.stdout) { - proc.stdout.on('data', c => stdout.push(c)).on('error', reject) - proc.stdout.on('error', er => reject(er)) - } - if (proc.stderr) { - proc.stderr.on('data', c => stderr.push(c)).on('error', reject) - proc.stderr.on('error', er => reject(er)) - } - proc.on('close', (code, signal) => { - const result = { - cmd, - args, - code, - signal, - ...stdioResult(stdout, stderr, opts), - ...extra - } - if (code || signal) - rej(Object.assign(new Error('command failed'), result)) - else - res(result) - }) - }) - - p.stdin = proc.stdin - p.process = proc - return p -} - -module.exports = promiseSpawn diff --git a/sandbox/testAppNevena/Front/node_modules/@npmcli/promise-spawn/package.json b/sandbox/testAppNevena/Front/node_modules/@npmcli/promise-spawn/package.json deleted file mode 100644 index be7342f5..00000000 --- a/sandbox/testAppNevena/Front/node_modules/@npmcli/promise-spawn/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@npmcli/promise-spawn", - "version": "1.3.2", - "files": [ - "index.js" - ], - "description": "spawn processes the way the npm cli likes to do", - "repository": { - "type": "git", - "url": "git+https://github.com/npm/promise-spawn" - }, - "author": "Isaac Z. Schlueter (https://izs.me)", - "license": "ISC", - "scripts": { - "test": "tap", - "snap": "tap", - "preversion": "npm test", - "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags" - }, - "tap": { - "check-coverage": true - }, - "devDependencies": { - "minipass": "^3.1.1", - "require-inject": "^1.4.4", - "tap": "^14.10.6" - }, - "dependencies": { - "infer-owner": "^1.0.4" - } -} -- cgit v1.2.3