@arcsine/nodesh
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -27,2 +27,3 @@ import { GlobalHelpers } from './helper'; | ||
const $range: GHStatic['$range']; | ||
const $exec: GHStatic['$exec']; | ||
} | ||
@@ -29,0 +30,0 @@ interface AsyncGenerator<T = unknown, TReturn = any, TNext = unknown> extends AllOps<T>, Promise<T[]> { |
@@ -31,2 +31,11 @@ /// <reference types="node" /> | ||
/** | ||
* Top level access to execute a program | ||
* | ||
* @example | ||
* $exec('ls', ['-lsa']) | ||
* .$columns(['blockSize', 'perms', 'size', 'group', 'owner', 'month', 'day', 'time', 'path']) | ||
* .$console | ||
*/ | ||
static get $exec(): AsyncIterable<any>['$exec']; | ||
/** | ||
* In the process of using the tool, there may be a need for encapsulating common | ||
@@ -33,0 +42,0 @@ * operations. By default, `$wrap` provides an easy path for re-using functionality, |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const register_1=require("./util/register");class GlobalHelpers{static $of(a){var b,c;return c=null===(b=a)||void 0===b?void 0:b.$iterable,null!==c&&void 0!==c?c:[a].$iterable}static get $registerOperator(){return register_1.RegisterUtil.registerOperators}static get $argv(){return process.argv.slice(3)}static get $stdin(){return process.stdin.$iterable}static get $env(){return new Proxy({},{get(a,b){var c,d;return d=(c=process.env[b],null!==c&&void 0!==c?c:process.env[b.toUpperCase()]),null!==d&&void 0!==d?d:process.env[b.toLowerCase()]}})}static get $pattern(){return{URL:/https?:\/\/[\/A-Za-z0-9:=?\-&.%]+/g,EMAIL:/[A-Za-z0-9_]+@[A-Za-z0-9_.]+[.][A-Za-z]+/g}}static async*$range(a,b=1,c=1){if(0<c&&a<b){const c=b;b=a,a=c}for(let d=b;d<=a;d+=c)yield d}}exports.GlobalHelpers=GlobalHelpers; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const register_1=require("./util/register");class GlobalHelpers{static $of(a){var b,c;return c=null===(b=a)||void 0===b?void 0:b.$iterable,null!==c&&void 0!==c?c:[a].$iterable}static get $exec(){return"".$exec.bind("")}static get $registerOperator(){return register_1.RegisterUtil.registerOperators}static get $argv(){return process.argv.slice(3)}static get $stdin(){return process.stdin.$iterable}static get $env(){return new Proxy({},{get(a,b){var c,d;return d=(c=process.env[b],null!==c&&void 0!==c?c:process.env[b.toUpperCase()]),null!==d&&void 0!==d?d:process.env[b.toLowerCase()]}})}static get $pattern(){return{URL:/https?:\/\/[\/A-Za-z0-9:=?\-&.%]+/g,EMAIL:/[A-Za-z0-9_]+@[A-Za-z0-9_.]+[.][A-Za-z]+/g}}static async*$range(a,b=1,c=1){if(0<c&&a<b){const c=b;b=a,a=c}for(let d=b;d<=a;d+=c)yield d}}exports.GlobalHelpers=GlobalHelpers; |
@@ -10,3 +10,2 @@ import { OrCallable, PromFunc, PromFunc2, $AsyncIterable } from '../types'; | ||
* sequence is exhausted. | ||
* @param fn | ||
* | ||
@@ -21,3 +20,2 @@ * @example | ||
* on each element. | ||
* @param fn | ||
* | ||
@@ -33,3 +31,2 @@ * @example | ||
* are discarded, while valid items are retained. | ||
* @param pred | ||
* | ||
@@ -45,3 +42,2 @@ * @example | ||
* return arrays/sequences, to be able to be represented as a single sequence. | ||
* @param this | ||
* | ||
@@ -58,3 +54,2 @@ * @example | ||
* or sequence), and producing a flattened output. | ||
* @param fn | ||
* | ||
@@ -61,0 +56,0 @@ * @example |
@@ -1,4 +0,2 @@ | ||
/// <reference types="node" /> | ||
import { $AsyncIterable, ExecConfig } from '../types'; | ||
import { Readable } from 'stream'; | ||
import { $AsyncIterable, ExecConfig, CompletableStream } from '../types'; | ||
/** | ||
@@ -35,3 +33,3 @@ * Support for dealing with execution of external programs | ||
$exec(cmd: string, config: ExecConfig<'binary'>): $AsyncIterable<Buffer>; | ||
$exec(cmd: string, config: ExecConfig<'raw'>): $AsyncIterable<Readable>; | ||
$exec(cmd: string, config: ExecConfig<'raw'>): $AsyncIterable<CompletableStream>; | ||
} |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const stream_1=require("../util/stream"),exec_1=require("../util/exec");class ExecOperators{async*$exec(a,b={}){const c=Array.isArray(b)?{args:b}:b,{proc:d,result:e}=exec_1.ExecUtil.exec(a,c);stream_1.StreamUtil.toStream(this,c.input).pipe(d.stdin),yield*await stream_1.StreamUtil.readStream(d.stdout,c),await e}}exports.ExecOperators=ExecOperators; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const stream_1=require("../util/stream"),exec_1=require("../util/exec"),async_1=require("../util/async");class ExecOperators{async*$exec(a,b={}){const c=Array.isArray(b)?{args:b}:b,{proc:d,result:e}=exec_1.ExecUtil.exec(a,c);if(stream_1.StreamUtil.toStream(this,c.input).pipe(d.stdin),"raw"===c.mode){const a=await stream_1.StreamUtil.readStream(d.stdout,c).$value;yield{...a,completed:async_1.AsyncUtil.combine(e,a.completed)}}else yield*await stream_1.StreamUtil.readStream(d.stdout,c);await e}}exports.ExecOperators=ExecOperators; |
@@ -0,1 +1,2 @@ | ||
import * as fs from 'fs'; | ||
import { ScanEntry } from '../util/file'; | ||
@@ -35,2 +36,3 @@ import { $AsyncIterable, ReadDirConfig, ReadStreamConfig } from '../types'; | ||
$read(this: AsyncIterable<string>, config: ReadStreamConfig<'binary'>): $AsyncIterable<Buffer>; | ||
$read(this: AsyncIterable<string>, config: ReadStreamConfig<'raw'>): $AsyncIterable<fs.ReadStream>; | ||
/** | ||
@@ -37,0 +39,0 @@ * `dir` provides the ability to recursively search for files within a file system. It expects as the |
import * as http from 'http'; | ||
import { $AsyncIterable, HttpOpts } from '../types'; | ||
import { $AsyncIterable, HttpOpts, CompletableStream } from '../types'; | ||
/** | ||
@@ -20,3 +20,3 @@ * Support for network based activities | ||
$http(this: AsyncIterable<string>, opts: HttpOpts<'binary'>): $AsyncIterable<Buffer>; | ||
$http(this: AsyncIterable<string>, opts: HttpOpts<'raw'>): $AsyncIterable<http.IncomingMessage>; | ||
$http(this: AsyncIterable<string>, opts: HttpOpts<'raw'>): $AsyncIterable<CompletableStream<http.IncomingMessage>>; | ||
/** | ||
@@ -36,3 +36,3 @@ * This is meant as a simple equivalent of `curl`. Will fetch a single page (and follow redirects). By default, | ||
$http(this: AsyncIterable<string | Buffer>, url: URL | string, opts: HttpOpts<'binary'>): $AsyncIterable<Buffer>; | ||
$http(this: AsyncIterable<string | Buffer>, url: URL | string, opts: HttpOpts<'raw'>): $AsyncIterable<http.IncomingMessage>; | ||
$http(this: AsyncIterable<string | Buffer>, url: URL | string, opts: HttpOpts<'raw'>): $AsyncIterable<CompletableStream<http.IncomingMessage>>; | ||
} |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const net_1=require("../util/net");class NetOperators{async*$http(a={},b){if("string"==typeof a||a instanceof URL){const c={...(null!==b&&void 0!==b?b:{}),data:this};yield*await net_1.NetUtil.httpRequest(a,c)}else for await(const b of this)yield*await net_1.NetUtil.httpRequest(b,a)}}exports.NetOperators=NetOperators; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const net_1=require("../util/net");class NetOperators{async*$http(a={},b){if("string"==typeof a||a instanceof URL){const c={mode:"text",...(null!==b&&void 0!==b?b:{}),data:this};yield*await net_1.NetUtil.httpRequest(a,c)}else for await(const b of this)yield*await net_1.NetUtil.httpRequest(b,{mode:"text",...a})}}exports.NetOperators=NetOperators; |
/// <reference types="node" /> | ||
import * as cp from 'child_process'; | ||
import { Readable } from 'stream'; | ||
export declare type $AsyncIterable<T> = AsyncIterable<T> & Promise<T[]>; | ||
@@ -30,1 +31,5 @@ export declare type IOType = 'text' | 'binary' | 'raw'; | ||
export declare type Pattern = string | Iterable<string> | RegExp; | ||
export declare type CompletableStream<T extends Readable = Readable> = { | ||
completed: Promise<void>; | ||
stream: T; | ||
}; |
@@ -7,2 +7,6 @@ export declare class AsyncUtil { | ||
static trackWithTimer(prom: Promise<any>): Promise<any>; | ||
/** | ||
* Combine promises into single, waiting on aux | ||
*/ | ||
static combine<T>(primary: Promise<T>, ...aux: Promise<any>[]): Promise<T>; | ||
} |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});class AsyncUtil{static trackWithTimer(a){const b=setTimeout(()=>{},100000000);return a.finally(()=>{b.unref()}),a}}exports.AsyncUtil=AsyncUtil; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});class AsyncUtil{static trackWithTimer(a){const b=setTimeout(()=>{},100000000);return a.finally(()=>{b.unref()}),a}static combine(a,...b){return Promise.all([a,...b]).then(()=>a)}}exports.AsyncUtil=AsyncUtil; |
/// <reference types="node" /> | ||
import * as http from 'http'; | ||
import { HttpOpts } from '../types'; | ||
import { HttpOpts, CompletableStream } from '../types'; | ||
export declare class NetUtil { | ||
@@ -12,3 +12,3 @@ static request(url: string, opts?: http.RequestOptions, data?: AsyncIterable<string | Buffer>): Promise<http.IncomingMessage>; | ||
static httpRequest(url: string | URL, outs: HttpOpts<'binary'>): AsyncIterable<Buffer>; | ||
static httpRequest(url: string | URL, outs: HttpOpts<'raw'>): AsyncIterable<http.IncomingMessage>; | ||
static httpRequest(url: string | URL, outs: HttpOpts<'raw'>): AsyncIterable<CompletableStream<http.IncomingMessage>>; | ||
} |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const http=require("http"),https=require("https"),stream_1=require("./stream");class NetUtil{static request(a,b={},c){const d=a.startsWith("https")?https.request:http.request;return new Promise((e,f)=>{const g=d(a,b,e);g.once("error",f),c?c.$stream().pipe(g):g.end()})}static async*httpRequest(a,b={}){var c,d,e,f;let g=0;"json"===b.contentType&&(b.contentType="application/json",b.data="string"==typeof b.data?b.data:JSON.stringify(b.data));for(const h={timeout:(c=b.timeout,null!==c&&void 0!==c?c:3e4),method:(d=b.method,null!==d&&void 0!==d?d:b.data?"POST":"GET"),headers:{...(e=b.headers,null!==e&&void 0!==e?e:{}),[`Content-Type`]:(f=b.contentType,null!==f&&void 0!==f?f:"application/octet-stream")}};6>g;){const c=await this.request(a,h,b.data);if(c.statusCode&&300<=c.statusCode&&400>c.statusCode&&c.headers.location){if(5===g)throw new Error(`Error fetching ${a}: too many redirect`);a=c.headers.location,g+=1;continue}else if(c.statusCode&&299<c.statusCode)throw new Error(`Error fetching ${a}: ${c.statusMessage}`);else return void(yield*await stream_1.StreamUtil.yieldRaw(c,b.mode))}}}exports.NetUtil=NetUtil; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const http=require("http"),https=require("https"),stream_1=require("./stream");class NetUtil{static request(a,b={},c){const d=a.startsWith("https")?https.request:http.request;return new Promise((e,f)=>{const g=d(a,b,e);g.once("error",f),c?c.$stream().pipe(g):g.end()})}static async*httpRequest(a,b={}){var c,d,e,f;let g=0;"json"===b.contentType&&(b.contentType="application/json",b.data="string"==typeof b.data||b.data instanceof Buffer?b.data:JSON.stringify(b.data));for(const h={timeout:(c=b.timeout,null!==c&&void 0!==c?c:3e4),method:(d=b.method,null!==d&&void 0!==d?d:b.data?"POST":"GET"),headers:{...(e=b.headers,null!==e&&void 0!==e?e:{}),[`Content-Type`]:(f=b.contentType,null!==f&&void 0!==f?f:"application/octet-stream")}};6>g;){const c=await this.request(a,h,b.data);if(c.statusCode&&300<=c.statusCode&&400>c.statusCode&&c.headers.location){if(5===g)throw new Error(`Error fetching ${a}: too many redirect`);a=c.headers.location,g+=1;continue}else if(c.statusCode&&299<c.statusCode)throw new Error(`Error fetching ${a}: ${c.statusMessage}`);else return void(yield*stream_1.StreamUtil.readStream(c,b))}}}exports.NetUtil=NetUtil; |
/// <reference types="node" /> | ||
import * as fs from 'fs'; | ||
import { Readable, Writable } from 'stream'; | ||
import { IOType, $AsyncIterable, ReadStreamConfig } from '../types'; | ||
import { IOType, $AsyncIterable, ReadStreamConfig, CompletableStream } from '../types'; | ||
declare class MemoryStream extends Writable { | ||
@@ -20,4 +20,2 @@ store: Buffer[]; | ||
static toStream(gen: AsyncIterable<any>, mode?: IOType): Readable; | ||
static yieldRaw<T>(input: T, mode: 'raw'): $AsyncIterable<T>; | ||
static yieldRaw<T>(input: AsyncIterable<T>, mode?: IOType): $AsyncIterable<T>; | ||
/** | ||
@@ -29,3 +27,3 @@ * Convert read stream into a sequence | ||
static readStream(input: Readable | string, config: ReadStreamConfig<'binary'>): $AsyncIterable<Buffer>; | ||
static readStream<T extends Readable>(input: T | string, config: ReadStreamConfig<'raw'>): $AsyncIterable<T>; | ||
static readStream<T extends Readable>(input: T | string, config: ReadStreamConfig<'raw'>): $AsyncIterable<CompletableStream<T>>; | ||
/** | ||
@@ -32,0 +30,0 @@ * Track a stream to wait until finished |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const readline=require("readline"),fs=require("fs"),stream_1=require("stream"),time_1=require("./time"),async_1=require("./async"),text_1=require("./text");class MemoryStream extends stream_1.Writable{constructor(){super(...arguments),this.store=[]}_write(a,b,c){this.store.push(a),c()}getText(){return this.store.map(a=>a.toString("utf8")).join("")}}class StreamUtil{static memoryWritable(){return new MemoryStream}static toStream(a,b){const c=stream_1.Readable.from(async function*(){for await(const c of a)if(void 0!==c)if(c instanceof Buffer)b&&"binary"!==b?yield c.toString("utf8"):yield c;else{const a=text_1.TextUtil.toText(c);b&&"text"!==b?yield Buffer.from(a,"utf8"):yield a}}());return c}static async*yieldRaw(a,b){"raw"===b?yield a:yield*a}static async*readStream(a,b={}){var c;const d=(c=b.mode,null!==c&&void 0!==c?c:"text"),e="string"==typeof a?fs.createReadStream(a,{encoding:"utf8"}):a,f=this.trackStream(e);if("raw"===d){return void(yield*await this.yieldRaw(a,"raw"))}const g="text"===d?readline.createInterface(e):e;let h=!1,i=[];for(g.on("close",()=>h=!0),"text"===d?g.on("line",a=>{const b="string"==typeof a?a:a.toString("utf8");i.push(`${b}\n`)}):g.on("data",a=>{i.push("string"==typeof a?Buffer.from(a,"utf8"):a)});!h;)await time_1.TimeUtil.sleep(50),!b.singleValue&&i.length&&(yield*i,i=[]);b.singleValue&&(i="text"===d?[i.join("")]:[Buffer.concat(i)]),i.length&&(yield*i),e.destroyed||e.destroy(),await f}static trackStream(a){return async_1.AsyncUtil.trackWithTimer(new Promise((b,c)=>{"writable"in a?a.on("finish",b):a.on("end",b),a.on("close",b),a.on("error",c)}))}static getWritable(a){return"string"!=typeof a&&"write"in a?a:fs.createWriteStream(a,{flags:"w",autoClose:!0})}}exports.StreamUtil=StreamUtil; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const readline=require("readline"),fs=require("fs"),stream_1=require("stream"),time_1=require("./time"),async_1=require("./async"),text_1=require("./text");class MemoryStream extends stream_1.Writable{constructor(){super(...arguments),this.store=[]}_write(a,b,c){this.store.push(a),c()}getText(){return this.store.map(a=>a.toString("utf8")).join("")}}class StreamUtil{static memoryWritable(){return new MemoryStream}static toStream(a,b){const c=stream_1.Readable.from(async function*(){for await(const c of a)if(void 0!==c)if(c instanceof Buffer)b&&"binary"!==b?yield c.toString("utf8"):yield c;else{const a=text_1.TextUtil.toText(c);b&&"text"!==b?yield Buffer.from(a,"utf8"):yield a}}());return c}static async*readStream(a,b={}){var c;const d=(c=b.mode,null!==c&&void 0!==c?c:"text"),e="string"==typeof a?fs.createReadStream(a,{encoding:"utf8"}):a,f=this.trackStream(e);if("raw"===d){return void(yield{stream:a,completed:f})}const g="text"===d?readline.createInterface(e):e;let h=!1,i=[];for(g.on("close",()=>h=!0),"text"===d?g.on("line",a=>{const b="string"==typeof a?a:a.toString("utf8");i.push(`${b}\n`)}):g.on("data",a=>{i.push("string"==typeof a?Buffer.from(a,"utf8"):a)});!h;)await time_1.TimeUtil.sleep(50),!b.singleValue&&i.length&&(yield*i,i=[]);b.singleValue&&(i="text"===d?[i.join("")]:[Buffer.concat(i)]),i.length&&(yield*i),e.destroyed||e.destroy(),await f}static trackStream(a){return async_1.AsyncUtil.trackWithTimer(new Promise((b,c)=>{"writable"in a?a.on("finish",b):a.on("end",b),a.on("close",b),a.on("error",c)}))}static getWritable(a){return"string"!=typeof a&&"write"in a?a:fs.createWriteStream(a,{flags:"w",autoClose:!0})}}exports.StreamUtil=StreamUtil; |
{ | ||
"name": "@arcsine/nodesh", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -1,4 +0,8 @@ | ||
# Node Shell | ||
Node shell is an npm package aimed at providing bash-like operations/simplicity within the node ecosystem. The goal is to make working with files/folders, http requests, and transformations, as as easy as possible. The library is built upon the async generation constructs within Ecmascript as well as stream constructs within the node ecosystem. This means the performance is iterative and real-time, just in the same way piping works in a Unix shell. | ||
<h1> | ||
<sub><img src="https://github.com/arciisine/nodesh/raw/master/images/logo.png" height="40"></sub> | ||
Nodesh - The Node Shell | ||
</h1> | ||
Nodesh is an `npm` package aimed at providing shell-like operations/simplicity within the node ecosystem. The goal is to make working with files/folders, http requests, and transformations, as easy as possible. The library is built upon the async generation constructs within ecmascript as well as stream constructs within the node ecosystem. This means the performance is iterative and real-time, the same way piping works in a Unix shell. | ||
**(remote-tokens.js) Example of processing URLs from the input stream** | ||
@@ -20,3 +24,3 @@ | ||
**NOTE:** The shebang defined here is using `env`'s `-S` flag which will allow for the passing of arguments in the shebang. | ||
**NOTE:** The shebang defined here is using `env`'s `-S` flag which will allow for the passing of multiple arguments in the shebang. | ||
@@ -147,2 +151,17 @@ As you can see above, the library's aim is to mimic the pattern of command piping, as well as integrate with stdin/stdout seamlessly. With the shebang applied appropriately, this script can be used just like any other cli command. | ||
#### $exec | ||
Top level access to execute a program | ||
```typescript | ||
static get $exec(): AsyncIterable<any>['$exec']; | ||
``` | ||
Example | ||
```javascript | ||
$exec('ls', ['-lsa']) | ||
.$columns(['blockSize', 'perms', 'size', 'group', 'owner', 'month', 'day', 'time', 'path']) | ||
.$console | ||
``` | ||
#### $registerOperator | ||
@@ -298,2 +317,3 @@ | ||
sequence is exhausted. | ||
```typescript | ||
@@ -313,2 +333,3 @@ $forEach<T>(this: AsyncIterable<T>, fn: PromFunc<T, any>): Promise<void>; | ||
on each element. | ||
```typescript | ||
@@ -329,2 +350,3 @@ $map<T, U>(this: AsyncIterable<T>, fn: PromFunc<T, U>): $AsyncIterable<U>; | ||
are discarded, while valid items are retained. | ||
```typescript | ||
@@ -345,2 +367,3 @@ $filter<T>(this: AsyncIterable<T>, pred: PromFunc<T, boolean>): $AsyncIterable<T>; | ||
return arrays/sequences, to be able to be represented as a single sequence. | ||
```typescript | ||
@@ -362,2 +385,3 @@ $flatten<T, U>(this: AsyncIterable<AsyncIterable<U> | Iterable<U>>): $AsyncIterable<U>; | ||
or sequence), and producing a flattened output. | ||
```typescript | ||
@@ -473,2 +497,3 @@ $flatMap<T, U>(this: AsyncIterable<T>, fn: PromFunc<T, AsyncIterable<U> | Iterable<U>>): $AsyncIterable<U>; | ||
$read(this: AsyncIterable<string>, config: ReadStreamConfig<'binary'>): $AsyncIterable<Buffer>; | ||
$read(this: AsyncIterable<string>, config: ReadStreamConfig<'raw'>): $AsyncIterable<fs.ReadStream>; | ||
``` | ||
@@ -918,3 +943,3 @@ Example | ||
$exec(cmd: string, config: ExecConfig<'binary'>): $AsyncIterable<Buffer>; | ||
$exec(cmd: string, config: ExecConfig<'raw'>): $AsyncIterable<Readable>; | ||
$exec(cmd: string, config: ExecConfig<'raw'>): $AsyncIterable<CompletableStream>; | ||
``` | ||
@@ -921,0 +946,0 @@ Example |
@@ -1,4 +0,8 @@ | ||
# Node Shell | ||
Node shell is an npm package aimed at providing bash-like operations/simplicity within the node ecosystem. The goal is to make working with files/folders, http requests, and transformations, as as easy as possible. The library is built upon the async generation constructs within Ecmascript as well as stream constructs within the node ecosystem. This means the performance is iterative and real-time, just in the same way piping works in a Unix shell. | ||
<h1> | ||
<sub><img src="https://github.com/arciisine/nodesh/raw/master/images/logo.png" height="40"></sub> | ||
Nodesh - The Node Shell | ||
</h1> | ||
Nodesh is an `npm` package aimed at providing shell-like operations/simplicity within the node ecosystem. The goal is to make working with files/folders, http requests, and transformations, as easy as possible. The library is built upon the async generation constructs within ecmascript as well as stream constructs within the node ecosystem. This means the performance is iterative and real-time, the same way piping works in a Unix shell. | ||
**(remote-tokens.js) Example of processing URLs from the input stream** | ||
@@ -20,3 +24,3 @@ | ||
**NOTE:** The shebang defined here is using `env`'s `-S` flag which will allow for the passing of arguments in the shebang. | ||
**NOTE:** The shebang defined here is using `env`'s `-S` flag which will allow for the passing of multiple arguments in the shebang. | ||
@@ -23,0 +27,0 @@ As you can see above, the library's aim is to mimic the pattern of command piping, as well as integrate with stdin/stdout seamlessly. With the shebang applied appropriately, this script can be used just like any other cli command. |
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 2 instances in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 2 instances in 1 package
98622
1143
1118