Skip to content

Commit 92eb924

Browse files
authored
🐛 ⚡ isFIFO, css, tldr (#43)
1 parent 5028642 commit 92eb924

File tree

22 files changed

+747
-2818
lines changed

22 files changed

+747
-2818
lines changed

bin/info.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export async function printCliUsage(){
8787
echo(`%c${n} --eval`, css.T);
8888
echo(`%c${n} --completion`, css.T);
8989
echo(`%c${n} --inspect`, css.T);
90-
echo(`%c${n} --man`, css.T);
90+
echo(`%c${n} --tldr`, css.T);
9191
echo("%cExamples%c:", css.H);
9292
echo(`%c${n} ./script.js`, css.T);
9393
echo(`%c${n} --help`, css.T);

docs/interfaces/EchoFunction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ const css= style("@import './file.css'");
101101

102102
#### Parameters
103103

104-
• ...**styles**: (\`.$\{string\}\{ @import "$\{string\}" \}\` \| \`.$\{string\}\{ display: none; \}\` \| \`.$\{string\}\{ display: list-item; \}\` \| \`.$\{string\}\{ color: black; \}\` \| \`.$\{string\}\{ color: blue; \}\` \| \`.$\{string\}\{ color: cyan; \}\` \| \`.$\{string\}\{ color: gray; \}\` \| \`.$\{string\}\{ color: green; \}\` \| \`.$\{string\}\{ color: magenta; \}\` \| \`.$\{string\}\{ color: red; \}\` \| \`.$\{string\}\{ color: white; \}\` \| \`.$\{string\}\{ color: yellow; \}\` \| \`.$\{string\}\{ color: lightred; \}\` \| \`.$\{string\}\{ color: lightgreen; \}\` \| \`.$\{string\}\{ color: lightyellow; \}\` \| \`.$\{string\}\{ color: lightblue; \}\` \| \`.$\{string\}\{ color: lightmagenta; \}\` \| \`.$\{string\}\{ color: lightcyan; \}\` \| \`.$\{string\}\{ color: whitesmoke; \}\` \| \`.$\{string\}\{ background: black; \}\` \| \`.$\{string\}\{ background: blue; \}\` \| \`.$\{string\}\{ background: cyan; \}\` \| \`.$\{string\}\{ background: gray; \}\` \| \`.$\{string\}\{ background: green; \}\` \| \`.$\{string\}\{ background: magenta; \}\` \| \`.$\{string\}\{ background: red; \}\` \| \`.$\{string\}\{ background: white; \}\` \| \`.$\{string\}\{ background: yellow; \}\` \| \`.$\{string\}\{ background: lightred; \}\` \| \`.$\{string\}\{ background: lightgreen; \}\` \| \`.$\{string\}\{ background: lightyellow; \}\` \| \`.$\{string\}\{ background: lightblue; \}\` \| \`.$\{string\}\{ background: lightmagenta; \}\` \| \`.$\{string\}\{ background: lightcyan; \}\` \| \`.$\{string\}\{ background: whitesmoke; \}\` \| \`.$\{string\}\{ margin-left: $\{number\}; \}\` \| \`.$\{string\}\{ margin-right: $\{number\}; \}\` \| \`.$\{string\}\{ text-decoration: underline \}\` \| \`.$\{string\}\{ text-decoration: line-through \}\` \| \`.$\{string\}\{ list-style-type: $\{string\} \}\` \| \`.$\{string\}\{ unset: all; \}\` \| \`.$\{string\}\{ font-style: italic; \}\` \| \`.$\{string\}\{ font-weight: bold; \}\` \| \`.$\{string\}\{ animation: blink; \}\`)[]
104+
• ...**styles**: (\`.$\{string\}\{ @import "$\{string\}" \}\` \| \`.$\{string\}\{ display: none; \}\` \| \`.$\{string\}\{ display: list-item; \}\` \| \`.$\{string\}\{ color: black; \}\` \| \`.$\{string\}\{ color: blue; \}\` \| \`.$\{string\}\{ color: cyan; \}\` \| \`.$\{string\}\{ color: gray; \}\` \| \`.$\{string\}\{ color: green; \}\` \| \`.$\{string\}\{ color: magenta; \}\` \| \`.$\{string\}\{ color: red; \}\` \| \`.$\{string\}\{ color: white; \}\` \| \`.$\{string\}\{ color: yellow; \}\` \| \`.$\{string\}\{ color: rgb($\{number\} $\{number\} $\{number\}); \}\` \| \`.$\{string\}\{ color: rgb($\{number\}, $\{number\}, $\{number\}); \}\` \| \`.$\{string\}\{ color: lightred; \}\` \| \`.$\{string\}\{ color: lightgreen; \}\` \| \`.$\{string\}\{ color: lightyellow; \}\` \| \`.$\{string\}\{ color: lightblue; \}\` \| \`.$\{string\}\{ color: lightmagenta; \}\` \| \`.$\{string\}\{ color: lightcyan; \}\` \| \`.$\{string\}\{ color: whitesmoke; \}\` \| \`.$\{string\}\{ background: black; \}\` \| \`.$\{string\}\{ background: blue; \}\` \| \`.$\{string\}\{ background: cyan; \}\` \| \`.$\{string\}\{ background: gray; \}\` \| \`.$\{string\}\{ background: green; \}\` \| \`.$\{string\}\{ background: magenta; \}\` \| \`.$\{string\}\{ background: red; \}\` \| \`.$\{string\}\{ background: white; \}\` \| \`.$\{string\}\{ background: yellow; \}\` \| \`.$\{string\}\{ background: rgb($\{number\} $\{number\} $\{number\}); \}\` \| \`.$\{string\}\{ background: rgb($\{number\}, $\{number\}, $\{number\}); \}\` \| \`.$\{string\}\{ background: lightred; \}\` \| \`.$\{string\}\{ background: lightgreen; \}\` \| \`.$\{string\}\{ background: lightyellow; \}\` \| \`.$\{string\}\{ background: lightblue; \}\` \| \`.$\{string\}\{ background: lightmagenta; \}\` \| \`.$\{string\}\{ background: lightcyan; \}\` \| \`.$\{string\}\{ background: whitesmoke; \}\` \| \`.$\{string\}\{ margin-left: $\{number\}; \}\` \| \`.$\{string\}\{ margin-right: $\{number\}; \}\` \| \`.$\{string\}\{ text-decoration: underline \}\` \| \`.$\{string\}\{ text-decoration: line-through \}\` \| \`.$\{string\}\{ list-style-type: $\{string\} \}\` \| \`.$\{string\}\{ unset: all; \}\` \| \`.$\{string\}\{ font-style: italic; \}\` \| \`.$\{string\}\{ font-weight: bold; \}\` \| \`.$\{string\}\{ animation: blink; \}\`)[]
105105

106106
#### Returns
107107

docs/namespaces/$/functions/isFIFO.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ Method to check whether script stdin/stdout (0/1) is a first-in-first-out (FIFO)
1313
node pipes.js |# — test by $.isFIFO(1)
1414
| node pipes.js # — test by $.isFIFO(0)
1515
```
16+
…more precisely:
17+
```javascript
18+
import { stdin, stdout } from "node:process";
19+
echo($.isFIFO(stdin.fd), $.isFIFO(stdout.fd));
20+
```
21+
⚠️ On Windows it can throw an error (see https://github.com/jaandrle/nodejsscript/issues/42)!
1622

1723
## Parameters
1824

docs/namespaces/$/variables/stdin.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88

99
> `const` **stdin**: [`STDIN`](../interfaces/STDIN.md)
1010
11-
Holding `stdin` when script was executed.
11+
Holding `stdin` when script was executed with pipe.
1212
```bash
1313
echo TEST | nodejsscript script.js
1414
```
1515
```javascript
1616
echo($.stdin.text());//= "TEST"
1717
```
18+
…but it can be empty in case of platform specific error (see [$.isFIFO](../functions/isFIFO.md)).

docs/namespaces/fetch/classes/Headers.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,37 +120,37 @@ In all methods of this interface, header names are matched by case-insensitive b
120120

121121
### entries()
122122

123-
> **entries**(): `IterableIterator`\<[`string`, `string`]\>
123+
> **entries**(): `IterableIterator`\<[`string`, `string`], `any`, `any`\>
124124
125125
Returns an iterator allowing to go through all key/value pairs contained in this object.
126126

127127
#### Returns
128128

129-
`IterableIterator`\<[`string`, `string`]\>
129+
`IterableIterator`\<[`string`, `string`], `any`, `any`\>
130130

131131
***
132132

133133
### keys()
134134

135-
> **keys**(): `IterableIterator`\<`string`\>
135+
> **keys**(): `IterableIterator`\<`string`, `any`, `any`\>
136136
137137
Returns an iterator allowing to go through all keys of the key/value pairs contained in this object.
138138

139139
#### Returns
140140

141-
`IterableIterator`\<`string`\>
141+
`IterableIterator`\<`string`, `any`, `any`\>
142142

143143
***
144144

145145
### values()
146146

147-
> **values**(): `IterableIterator`\<`string`\>
147+
> **values**(): `IterableIterator`\<`string`, `any`, `any`\>
148148
149149
Returns an iterator allowing to go through all values of the key/value pairs contained in this object.
150150

151151
#### Returns
152152

153-
`IterableIterator`\<`string`\>
153+
`IterableIterator`\<`string`, `any`, `any`\>
154154

155155
***
156156

@@ -168,8 +168,8 @@ Node-fetch extension
168168

169169
### \[iterator\]()
170170

171-
> **\[iterator\]**(): `IterableIterator`\<[`string`, `string`]\>
171+
> **\[iterator\]**(): `IterableIterator`\<[`string`, `string`], `any`, `any`\>
172172
173173
#### Returns
174174

175-
`IterableIterator`\<[`string`, `string`]\>
175+
`IterableIterator`\<[`string`, `string`], `any`, `any`\>

docs/namespaces/s/classes/ProcessOutput.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,39 +108,47 @@ https://v8.dev/docs/stack-trace-api#customizing-stack-traces
108108

109109
### stdout
110110

111-
> `get` **stdout**(): `string`
111+
#### Get Signature
112112

113-
#### Returns
113+
> **get** **stdout**(): `string`
114+
115+
##### Returns
114116

115117
`string`
116118

117119
***
118120

119121
### stderr
120122

121-
> `get` **stderr**(): `string`
123+
#### Get Signature
122124

123-
#### Returns
125+
> **get** **stderr**(): `string`
126+
127+
##### Returns
124128

125129
`string`
126130

127131
***
128132

129133
### exitCode
130134

131-
> `get` **exitCode**(): `number`
135+
#### Get Signature
132136

133-
#### Returns
137+
> **get** **exitCode**(): `number`
138+
139+
##### Returns
134140

135141
`number`
136142

137143
***
138144

139145
### signal
140146

141-
> `get` **signal**(): `Signals`
147+
#### Get Signature
142148

143-
#### Returns
149+
> **get** **signal**(): `Signals`
150+
151+
##### Returns
144152

145153
`Signals`
146154

docs/namespaces/s/classes/ProcessPromise.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,29 +64,35 @@ and a reject callback used to reject the promise with a provided reason or error
6464

6565
### stdin
6666

67-
> `get` **stdin**(): `Writable`
67+
#### Get Signature
6868

69-
#### Returns
69+
> **get** **stdin**(): `Writable`
70+
71+
##### Returns
7072

7173
`Writable`
7274

7375
***
7476

7577
### stdout
7678

77-
> `get` **stdout**(): `Readable`
79+
#### Get Signature
7880

79-
#### Returns
81+
> **get** **stdout**(): `Readable`
82+
83+
##### Returns
8084

8185
`Readable`
8286

8387
***
8488

8589
### stderr
8690

87-
> `get` **stderr**(): `Readable`
91+
#### Get Signature
8892

89-
#### Returns
93+
> **get** **stderr**(): `Readable`
94+
95+
##### Returns
9096

9197
`Readable`
9298

@@ -107,7 +113,7 @@ resolve, or rejected when any Promise is rejected.
107113

108114
##### Parameters
109115

110-
**values**: `Iterable`\<`T` \| `PromiseLike`\<`T`\>\>
116+
**values**: `Iterable`\<`T` \| `PromiseLike`\<`T`\>, `any`, `any`\>
111117

112118
An iterable of Promises.
113119

@@ -165,7 +171,7 @@ or rejected.
165171

166172
##### Parameters
167173

168-
**values**: `Iterable`\<`T` \| `PromiseLike`\<`T`\>\>
174+
**values**: `Iterable`\<`T` \| `PromiseLike`\<`T`\>, `any`, `any`\>
169175

170176
An iterable of Promises.
171177

@@ -350,7 +356,7 @@ of the provided Promises resolve or reject.
350356

351357
##### Parameters
352358

353-
**values**: `Iterable`\<`T` \| `PromiseLike`\<`T`\>\>
359+
**values**: `Iterable`\<`T` \| `PromiseLike`\<`T`\>, `any`, `any`\>
354360

355361
An array of Promises.
356362

docs/namespaces/s/interfaces/ShellReturnValue.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ Returns a string containing the given pipeline, or a concatenated string
2424
containing the pipelines if more than one input stream is given
2525
(a new line character is introduced between each input).
2626

27+
#### Returns
28+
29+
A string containing the given pipeline, or a concatenated string
30+
containing the pipelines if more than one input stream is given
31+
(a new line character is introduced between each input).
32+
2733
***
2834

2935
### exec
@@ -44,6 +50,11 @@ Silence and synchronous options.
4450

4551
Receives code and output asynchronously.
4652

53+
#### Returns
54+
55+
Returns an object containing the return code and output as string,
56+
or if `{async: true}` or a `callback` was passed, a `ChildProcess`.
57+
4758
***
4859

4960
### head
@@ -72,6 +83,10 @@ Available options:
7283

7384
The regular expression to use.
7485

86+
#### Returns
87+
88+
Returns a string containing all lines of the file that match the given `regex_filter`.
89+
7590
***
7691

7792
### sed
@@ -94,6 +109,10 @@ The regular expression to use for search.
94109

95110
The replacement.
96111

112+
#### Returns
113+
114+
The new string after replacement.
115+
97116
***
98117

99118
### sort

docs/namespaces/s/interfaces/ShellReturnValueNJS.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ Returns a string containing the given pipeline, or a concatenated string
6666
containing the pipelines if more than one input stream is given
6767
(a new line character is introduced between each input).
6868

69+
#### Returns
70+
71+
A string containing the given pipeline, or a concatenated string
72+
containing the pipelines if more than one input stream is given
73+
(a new line character is introduced between each input).
74+
6975
#### Inherited from
7076

7177
[`ShellReturnValue`](ShellReturnValue.md).[`cat`](ShellReturnValue.md#cat)
@@ -90,6 +96,11 @@ Silence and synchronous options.
9096

9197
Receives code and output asynchronously.
9298

99+
#### Returns
100+
101+
Returns an object containing the return code and output as string,
102+
or if `{async: true}` or a `callback` was passed, a `ChildProcess`.
103+
93104
#### Inherited from
94105

95106
[`ShellReturnValue`](ShellReturnValue.md).[`exec`](ShellReturnValue.md#exec)
@@ -126,6 +137,10 @@ Available options:
126137

127138
The regular expression to use.
128139

140+
#### Returns
141+
142+
Returns a string containing all lines of the file that match the given `regex_filter`.
143+
129144
#### Inherited from
130145

131146
[`ShellReturnValue`](ShellReturnValue.md).[`grep`](ShellReturnValue.md#grep)
@@ -152,6 +167,10 @@ The regular expression to use for search.
152167

153168
The replacement.
154169

170+
#### Returns
171+
172+
The new string after replacement.
173+
155174
#### Inherited from
156175

157176
[`ShellReturnValue`](ShellReturnValue.md).[`sed`](ShellReturnValue.md#sed)

0 commit comments

Comments
 (0)