mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-05-20 21:14:45 +00:00
.
This commit is contained in:
parent
a004f0ae58
commit
fc725ba36b
7280 changed files with 19 additions and 1796407 deletions
33
node_modules/get-stdin/index.d.ts
generated
vendored
33
node_modules/get-stdin/index.d.ts
generated
vendored
|
@ -1,33 +0,0 @@
|
|||
/// <reference types="node"/>
|
||||
|
||||
declare const getStdin: {
|
||||
/**
|
||||
Get [`stdin`](https://nodejs.org/api/process.html#process_process_stdin) as a `string`.
|
||||
|
||||
@returns A promise that is resolved when the `end` event fires on the `stdin` stream, indicating that there is no more data to be read. In a TTY context, an empty `string` is returned.
|
||||
|
||||
@example
|
||||
```
|
||||
// example.ts
|
||||
import getStdin = require('get-stdin');
|
||||
|
||||
(async () => {
|
||||
console.log(await getStdin());
|
||||
//=> 'unicorns'
|
||||
})
|
||||
|
||||
// $ echo unicorns | ts-node example.ts
|
||||
// unicorns
|
||||
```
|
||||
*/
|
||||
(): Promise<string>;
|
||||
|
||||
/**
|
||||
Get [`stdin`](https://nodejs.org/api/process.html#process_process_stdin) as a `Buffer`.
|
||||
|
||||
@returns A promise that is resolved when the `end` event fires on the `stdin` stream, indicating that there is no more data to be read. In a TTY context, an empty `Buffer` is returned.
|
||||
*/
|
||||
buffer(): Promise<Buffer>;
|
||||
};
|
||||
|
||||
export = getStdin;
|
52
node_modules/get-stdin/index.js
generated
vendored
52
node_modules/get-stdin/index.js
generated
vendored
|
@ -1,52 +0,0 @@
|
|||
'use strict';
|
||||
const {stdin} = process;
|
||||
|
||||
module.exports = () => {
|
||||
let result = '';
|
||||
|
||||
return new Promise(resolve => {
|
||||
if (stdin.isTTY) {
|
||||
resolve(result);
|
||||
return;
|
||||
}
|
||||
|
||||
stdin.setEncoding('utf8');
|
||||
|
||||
stdin.on('readable', () => {
|
||||
let chunk;
|
||||
|
||||
while ((chunk = stdin.read())) {
|
||||
result += chunk;
|
||||
}
|
||||
});
|
||||
|
||||
stdin.on('end', () => {
|
||||
resolve(result);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
module.exports.buffer = () => {
|
||||
const result = [];
|
||||
let length = 0;
|
||||
|
||||
return new Promise(resolve => {
|
||||
if (stdin.isTTY) {
|
||||
resolve(Buffer.concat([]));
|
||||
return;
|
||||
}
|
||||
|
||||
stdin.on('readable', () => {
|
||||
let chunk;
|
||||
|
||||
while ((chunk = stdin.read())) {
|
||||
result.push(chunk);
|
||||
length += chunk.length;
|
||||
}
|
||||
});
|
||||
|
||||
stdin.on('end', () => {
|
||||
resolve(Buffer.concat(result, length));
|
||||
});
|
||||
});
|
||||
};
|
9
node_modules/get-stdin/license
generated
vendored
9
node_modules/get-stdin/license
generated
vendored
|
@ -1,9 +0,0 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
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.
|
75
node_modules/get-stdin/package.json
generated
vendored
75
node_modules/get-stdin/package.json
generated
vendored
|
@ -1,75 +0,0 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
"get-stdin@7.0.0",
|
||||
"/Users/eric/repos/actions/setup-node"
|
||||
]
|
||||
],
|
||||
"_development": true,
|
||||
"_from": "get-stdin@7.0.0",
|
||||
"_id": "get-stdin@7.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ==",
|
||||
"_location": "/get-stdin",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "get-stdin@7.0.0",
|
||||
"name": "get-stdin",
|
||||
"escapedName": "get-stdin",
|
||||
"rawSpec": "7.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "7.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/husky"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-7.0.0.tgz",
|
||||
"_spec": "7.0.0",
|
||||
"_where": "/Users/eric/repos/actions/setup-node",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/get-stdin/issues"
|
||||
},
|
||||
"description": "Get stdin as a string or buffer",
|
||||
"devDependencies": {
|
||||
"@types/node": "^11.13.4",
|
||||
"ava": "^1.4.1",
|
||||
"delay": "^4.2.0",
|
||||
"tsd": "^0.7.2",
|
||||
"xo": "^0.24.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/get-stdin#readme",
|
||||
"keywords": [
|
||||
"std",
|
||||
"stdin",
|
||||
"stdio",
|
||||
"concat",
|
||||
"buffer",
|
||||
"stream",
|
||||
"process",
|
||||
"read"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "get-stdin",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/get-stdin.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava test.js test-buffer.js && echo unicorns | node test-real.js && tsd"
|
||||
},
|
||||
"version": "7.0.0"
|
||||
}
|
55
node_modules/get-stdin/readme.md
generated
vendored
55
node_modules/get-stdin/readme.md
generated
vendored
|
@ -1,55 +0,0 @@
|
|||
# get-stdin [](https://travis-ci.org/sindresorhus/get-stdin)
|
||||
|
||||
> Get [stdin](https://nodejs.org/api/process.html#process_process_stdin) as a string or buffer
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install get-stdin
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
// example.js
|
||||
const getStdin = require('get-stdin');
|
||||
|
||||
(async () => {
|
||||
console.log(await getStdin());
|
||||
//=> 'unicorns'
|
||||
})();
|
||||
```
|
||||
|
||||
```
|
||||
$ echo unicorns | node example.js
|
||||
unicorns
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
Both methods returns a promise that is resolved when the `end` event fires on the `stdin` stream, indicating that there is no more data to be read.
|
||||
|
||||
### getStdin()
|
||||
|
||||
Get `stdin` as a `string`.
|
||||
|
||||
In a TTY context, a promise that resolves to an empty `string` is returned.
|
||||
|
||||
### getStdin.buffer()
|
||||
|
||||
Get `stdin` as a `Buffer`.
|
||||
|
||||
In a TTY context, a promise that resolves to an empty `Buffer` is returned.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [get-stream](https://github.com/sindresorhus/get-stream) - Get a stream as a string or buffer
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
Loading…
Add table
Add a link
Reference in a new issue