@ohos-ports/stdlib-process 0.0.0-stage → 0.4.1-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/LICENSE +177 -0
  2. package/NOTICE +1 -0
  3. package/README.md +220 -2
  4. package/SECURITY.md +5 -0
  5. package/argv/README.md +104 -0
  6. package/argv/docs/repl.txt +22 -0
  7. package/argv/docs/types/index.d.ts +33 -0
  8. package/argv/docs/types/test.ts +28 -0
  9. package/argv/lib/browser.js +28 -0
  10. package/argv/lib/index.js +40 -0
  11. package/argv/lib/main.js +43 -0
  12. package/argv/package.json +70 -0
  13. package/chdir/README.md +124 -0
  14. package/chdir/docs/repl.txt +25 -0
  15. package/chdir/docs/types/index.d.ts +42 -0
  16. package/chdir/docs/types/test.ts +45 -0
  17. package/chdir/lib/index.js +42 -0
  18. package/chdir/lib/main.js +52 -0
  19. package/chdir/lib/polyfill.js +42 -0
  20. package/chdir/package.json +73 -0
  21. package/cwd/README.md +140 -0
  22. package/cwd/bin/cli +60 -0
  23. package/cwd/docs/repl.txt +17 -0
  24. package/cwd/docs/types/index.d.ts +35 -0
  25. package/cwd/docs/types/test.ts +33 -0
  26. package/cwd/docs/usage.txt +8 -0
  27. package/cwd/etc/cli_opts.json +14 -0
  28. package/cwd/lib/index.js +40 -0
  29. package/cwd/lib/main.js +44 -0
  30. package/cwd/lib/polyfill.js +40 -0
  31. package/cwd/package.json +75 -0
  32. package/docs/types/index.d.ts +225 -0
  33. package/env/README.md +104 -0
  34. package/env/docs/repl.txt +12 -0
  35. package/env/docs/types/index.d.ts +32 -0
  36. package/env/docs/types/test.ts +28 -0
  37. package/env/lib/browser.js +28 -0
  38. package/env/lib/index.js +39 -0
  39. package/env/lib/main.js +42 -0
  40. package/env/package.json +72 -0
  41. package/exec-path/README.md +90 -0
  42. package/exec-path/docs/repl.txt +13 -0
  43. package/exec-path/docs/types/index.d.ts +36 -0
  44. package/exec-path/docs/types/test.ts +28 -0
  45. package/exec-path/lib/browser.js +23 -0
  46. package/exec-path/lib/index.js +55 -0
  47. package/exec-path/lib/main.js +46 -0
  48. package/exec-path/package.json +72 -0
  49. package/getegid/README.md +107 -0
  50. package/getegid/docs/repl.txt +20 -0
  51. package/getegid/docs/types/index.d.ts +38 -0
  52. package/getegid/docs/types/test.ts +33 -0
  53. package/getegid/lib/index.js +39 -0
  54. package/getegid/lib/main.js +45 -0
  55. package/getegid/lib/native.js +44 -0
  56. package/getegid/lib/polyfill.js +40 -0
  57. package/getegid/package.json +76 -0
  58. package/geteuid/README.md +111 -0
  59. package/geteuid/docs/repl.txt +20 -0
  60. package/geteuid/docs/types/index.d.ts +38 -0
  61. package/geteuid/docs/types/test.ts +33 -0
  62. package/geteuid/lib/index.js +39 -0
  63. package/geteuid/lib/main.js +45 -0
  64. package/geteuid/lib/native.js +44 -0
  65. package/geteuid/lib/polyfill.js +40 -0
  66. package/geteuid/package.json +76 -0
  67. package/getgid/README.md +107 -0
  68. package/getgid/docs/repl.txt +19 -0
  69. package/getgid/docs/types/index.d.ts +38 -0
  70. package/getgid/docs/types/test.ts +33 -0
  71. package/getgid/lib/index.js +39 -0
  72. package/getgid/lib/main.js +45 -0
  73. package/getgid/lib/native.js +44 -0
  74. package/getgid/lib/polyfill.js +40 -0
  75. package/getgid/package.json +75 -0
  76. package/getuid/README.md +111 -0
  77. package/getuid/docs/repl.txt +19 -0
  78. package/getuid/docs/types/index.d.ts +38 -0
  79. package/getuid/docs/types/test.ts +33 -0
  80. package/getuid/lib/index.js +39 -0
  81. package/getuid/lib/main.js +45 -0
  82. package/getuid/lib/native.js +44 -0
  83. package/getuid/lib/polyfill.js +40 -0
  84. package/getuid/package.json +75 -0
  85. package/lib/index.js +150 -0
  86. package/node-version/README.md +135 -0
  87. package/node-version/bin/cli +60 -0
  88. package/node-version/docs/repl.txt +12 -0
  89. package/node-version/docs/types/index.d.ts +42 -0
  90. package/node-version/docs/types/test.ts +28 -0
  91. package/node-version/docs/usage.txt +8 -0
  92. package/node-version/etc/cli_opts.json +14 -0
  93. package/node-version/lib/browser.js +23 -0
  94. package/node-version/lib/index.js +60 -0
  95. package/node-version/lib/main.js +43 -0
  96. package/node-version/lib/process.js +28 -0
  97. package/node-version/package.json +73 -0
  98. package/package.json +121 -4
  99. package/read-stdin/README.md +152 -0
  100. package/read-stdin/docs/types/index.d.ts +108 -0
  101. package/read-stdin/docs/types/test.ts +73 -0
  102. package/read-stdin/lib/browser.js +66 -0
  103. package/read-stdin/lib/index.js +47 -0
  104. package/read-stdin/lib/main.js +159 -0
  105. package/read-stdin/package.json +67 -0
  106. package/umask/README.md +281 -0
  107. package/umask/bin/cli +84 -0
  108. package/umask/docs/repl.txt +133 -0
  109. package/umask/docs/types/index.d.ts +69 -0
  110. package/umask/docs/types/test.ts +62 -0
  111. package/umask/docs/usage.txt +9 -0
  112. package/umask/etc/cli_opts.json +22 -0
  113. package/umask/lib/browser.js +133 -0
  114. package/umask/lib/from_symbolic.js +218 -0
  115. package/umask/lib/index.js +40 -0
  116. package/umask/lib/main.js +128 -0
  117. package/umask/lib/octal_codes.json +10 -0
  118. package/umask/lib/to_symbolic.js +57 -0
  119. package/umask/package.json +78 -0
package/LICENSE ADDED
@@ -0,0 +1,177 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
package/NOTICE ADDED
@@ -0,0 +1 @@
1
+ Copyright (c) 2016-2026 The Stdlib Authors.
package/README.md CHANGED
@@ -1,3 +1,221 @@
1
- # Temporary Holding Version
1
+ <!--
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ @license Apache-2.0
4
+
5
+ Copyright (c) 2018 The Stdlib Authors.
6
+
7
+ Licensed under the Apache License, Version 2.0 (the "License");
8
+ you may not use this file except in compliance with the License.
9
+ You may obtain a copy of the License at
10
+
11
+ http://www.apache.org/licenses/LICENSE-2.0
12
+
13
+ Unless required by applicable law or agreed to in writing, software
14
+ distributed under the License is distributed on an "AS IS" BASIS,
15
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ See the License for the specific language governing permissions and
17
+ limitations under the License.
18
+
19
+ -->
20
+
21
+
22
+ <details>
23
+ <summary>
24
+ About stdlib...
25
+ </summary>
26
+ <p>We believe in a future in which the web is a preferred environment for numerical computation. To help realize this future, we've built stdlib. stdlib is a standard library, with an emphasis on numerical and scientific computation, written in JavaScript (and C) for execution in browsers and in Node.js.</p>
27
+ <p>The library is fully decomposable, being architected in such a way that you can swap out and mix and match APIs and functionality to cater to your exact preferences and use cases.</p>
28
+ <p>When you use stdlib, you can be absolutely certain that you are using the most thorough, rigorous, well-written, studied, documented, tested, measured, and high-quality code out there.</p>
29
+ <p>To join us in bringing numerical computing to the web, get started by checking us out on <a href="https://github.com/stdlib-js/stdlib">GitHub</a>, and please consider <a href="https://opencollective.com/stdlib">financially supporting stdlib</a>. We greatly appreciate your continued support!</p>
30
+ </details>
31
+
32
+ # Process
33
+
34
+ [![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] <!-- [![dependencies][dependencies-image]][dependencies-url] -->
35
+
36
+ > Process utilities.
37
+
38
+ <section class="installation">
39
+
40
+ ## Installation
41
+
42
+ ```bash
43
+ npm install @stdlib/process
44
+ ```
45
+
46
+ </section>
47
+
48
+ <section class="usage">
49
+
50
+ ## Usage
51
+
52
+ ```javascript
53
+ var ns = require( '@stdlib/process' );
54
+ ```
55
+
56
+ #### ns
57
+
58
+ Namespace containing process utilities.
59
+
60
+ ```javascript
61
+ var proc = ns;
62
+ // returns {...}
63
+ ```
64
+
65
+ The namespace contains process utilities:
66
+
67
+ <!-- <toc pattern="*"> -->
68
+
69
+ <div class="namespace-toc">
70
+
71
+ - <span class="signature">[`ARGV`][@stdlib/process/argv]</span><span class="delimiter">: </span><span class="description">array containing command-line arguments passed when launching the calling process.</span>
72
+ - <span class="signature">[`chdir( path )`][@stdlib/process/chdir]</span><span class="delimiter">: </span><span class="description">change the current working directory.</span>
73
+ - <span class="signature">[`cwd()`][@stdlib/process/cwd]</span><span class="delimiter">: </span><span class="description">return the current working directory.</span>
74
+ - <span class="signature">[`ENV`][@stdlib/process/env]</span><span class="delimiter">: </span><span class="description">object containing the user environment.</span>
75
+ - <span class="signature">[`EXEC_PATH`][@stdlib/process/exec-path]</span><span class="delimiter">: </span><span class="description">absolute pathname of the executable which started the current Node.js process.</span>
76
+ - <span class="signature">[`getegid()`][@stdlib/process/getegid]</span><span class="delimiter">: </span><span class="description">return the effective numeric group identity of the calling process.</span>
77
+ - <span class="signature">[`geteuid()`][@stdlib/process/geteuid]</span><span class="delimiter">: </span><span class="description">return the effective numeric user identity of the calling process.</span>
78
+ - <span class="signature">[`getgid()`][@stdlib/process/getgid]</span><span class="delimiter">: </span><span class="description">return the numeric group identity of the calling process.</span>
79
+ - <span class="signature">[`getuid()`][@stdlib/process/getuid]</span><span class="delimiter">: </span><span class="description">return the numeric user identity of the calling process.</span>
80
+ - <span class="signature">[`NODE_VERSION`][@stdlib/process/node-version]</span><span class="delimiter">: </span><span class="description">node version.</span>
81
+ - <span class="signature">[`stdin( [encoding,] clbk )`][@stdlib/process/read-stdin]</span><span class="delimiter">: </span><span class="description">read data from `stdin`.</span>
82
+ - <span class="signature">[`umask( [mask,] [options] )`][@stdlib/process/umask]</span><span class="delimiter">: </span><span class="description">get/set the process mask.</span>
83
+
84
+ </div>
85
+
86
+ <!-- </toc> -->
87
+
88
+ </section>
89
+
90
+ <!-- /.usage -->
91
+
92
+ <section class="examples">
93
+
94
+ ## Examples
95
+
96
+ <!-- TODO: better examples -->
97
+
98
+ <!-- eslint no-undef: "error" -->
99
+
100
+ ```javascript
101
+ var objectKeys = require( '@stdlib/utils/keys' );
102
+ var ns = require( '@stdlib/process' );
103
+
104
+ console.log( objectKeys( ns ) );
105
+ ```
106
+
107
+ </section>
108
+
109
+ <!-- /.examples -->
110
+
111
+ <!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
112
+
113
+ <section class="related">
114
+
115
+ </section>
116
+
117
+ <!-- /.related -->
118
+
119
+ <!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
120
+
121
+
122
+ <section class="main-repo" >
123
+
124
+ * * *
125
+
126
+ ## Notice
127
+
128
+ This package is part of [stdlib][stdlib], a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.
129
+
130
+ For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib].
131
+
132
+ #### Community
133
+
134
+ [![Chat][chat-image]][chat-url]
135
+
136
+ ---
137
+
138
+ ## License
139
+
140
+ See [LICENSE][stdlib-license].
141
+
142
+
143
+ ## Copyright
144
+
145
+ Copyright &copy; 2016-2026. The Stdlib [Authors][stdlib-authors].
146
+
147
+ </section>
148
+
149
+ <!-- /.stdlib -->
150
+
151
+ <!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
152
+
153
+ <section class="links">
154
+
155
+ [npm-image]: http://img.shields.io/npm/v/@stdlib/process.svg
156
+ [npm-url]: https://npmjs.org/package/@stdlib/process
157
+
158
+ [test-image]: https://github.com/stdlib-js/process/actions/workflows/test.yml/badge.svg?branch=v0.4.1
159
+ [test-url]: https://github.com/stdlib-js/process/actions/workflows/test.yml?query=branch:v0.4.1
160
+
161
+ [coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/process/main.svg
162
+ [coverage-url]: https://codecov.io/github/stdlib-js/process?branch=main
163
+
164
+ <!--
165
+
166
+ [dependencies-image]: https://img.shields.io/david/stdlib-js/process.svg
167
+ [dependencies-url]: https://david-dm.org/stdlib-js/process/main
168
+
169
+ -->
170
+
171
+ [chat-image]: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg
172
+ [chat-url]: https://stdlib.zulipchat.com
173
+
174
+ [stdlib]: https://github.com/stdlib-js/stdlib
175
+
176
+ [stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors
177
+
178
+ [umd]: https://github.com/umdjs/umd
179
+ [es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
180
+
181
+ [deno-url]: https://github.com/stdlib-js/process/tree/deno
182
+ [deno-readme]: https://github.com/stdlib-js/process/blob/deno/README.md
183
+ [umd-url]: https://github.com/stdlib-js/process/tree/umd
184
+ [umd-readme]: https://github.com/stdlib-js/process/blob/umd/README.md
185
+ [esm-url]: https://github.com/stdlib-js/process/tree/esm
186
+ [esm-readme]: https://github.com/stdlib-js/process/blob/esm/README.md
187
+ [branches-url]: https://github.com/stdlib-js/process/blob/main/branches.md
188
+
189
+ [stdlib-license]: https://raw.githubusercontent.com/stdlib-js/process/main/LICENSE
190
+
191
+ <!-- <toc-links> -->
192
+
193
+ [@stdlib/process/argv]: https://github.com/stdlib-js/process/tree/main/argv
194
+
195
+ [@stdlib/process/chdir]: https://github.com/stdlib-js/process/tree/main/chdir
196
+
197
+ [@stdlib/process/cwd]: https://github.com/stdlib-js/process/tree/main/cwd
198
+
199
+ [@stdlib/process/env]: https://github.com/stdlib-js/process/tree/main/env
200
+
201
+ [@stdlib/process/exec-path]: https://github.com/stdlib-js/process/tree/main/exec-path
202
+
203
+ [@stdlib/process/getegid]: https://github.com/stdlib-js/process/tree/main/getegid
204
+
205
+ [@stdlib/process/geteuid]: https://github.com/stdlib-js/process/tree/main/geteuid
206
+
207
+ [@stdlib/process/getgid]: https://github.com/stdlib-js/process/tree/main/getgid
208
+
209
+ [@stdlib/process/getuid]: https://github.com/stdlib-js/process/tree/main/getuid
210
+
211
+ [@stdlib/process/node-version]: https://github.com/stdlib-js/process/tree/main/node-version
212
+
213
+ [@stdlib/process/read-stdin]: https://github.com/stdlib-js/process/tree/main/read-stdin
214
+
215
+ [@stdlib/process/umask]: https://github.com/stdlib-js/process/tree/main/umask
216
+
217
+ <!-- </toc-links> -->
218
+
219
+ </section>
220
+
221
+ <!-- /.links -->
package/SECURITY.md ADDED
@@ -0,0 +1,5 @@
1
+ # Security
2
+
3
+ > Policy for reporting security vulnerabilities.
4
+
5
+ See the security policy [in the main project repository](https://github.com/stdlib-js/stdlib/security).
package/argv/README.md ADDED
@@ -0,0 +1,104 @@
1
+ <!--
2
+
3
+ @license Apache-2.0
4
+
5
+ Copyright (c) 2018 The Stdlib Authors.
6
+
7
+ Licensed under the Apache License, Version 2.0 (the "License");
8
+ you may not use this file except in compliance with the License.
9
+ You may obtain a copy of the License at
10
+
11
+ http://www.apache.org/licenses/LICENSE-2.0
12
+
13
+ Unless required by applicable law or agreed to in writing, software
14
+ distributed under the License is distributed on an "AS IS" BASIS,
15
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ See the License for the specific language governing permissions and
17
+ limitations under the License.
18
+
19
+ -->
20
+
21
+ # ARGV
22
+
23
+ > Array containing command-line arguments passed when launching the calling process.
24
+
25
+ <section class="usage">
26
+
27
+ ## Usage
28
+
29
+ ```javascript
30
+ var ARGV = require( '@stdlib/process/argv' );
31
+ ```
32
+
33
+ #### ARGV
34
+
35
+ `Array` containing command-line arguments passed when launching the calling process.
36
+
37
+ ```javascript
38
+ var execPath = ARGV[ 0 ];
39
+ // e.g., returns '/usr/local/bin/node'
40
+ ```
41
+
42
+ </section>
43
+
44
+ <!-- /.usage -->
45
+
46
+ <section class="notes">
47
+
48
+ ## Notes
49
+
50
+ - The first element is the absolute pathname of the executable that started the calling process.
51
+ - The second element is the path of the executed file.
52
+ - Any additional elements are additional command-line arguments.
53
+ - In browser environments, `ARGV` is an **empty** array.
54
+ - Modifications to `ARGV` are local to the process in which `ARGV` is modified.
55
+ - Be careful when modifying command-line arguments as the argument array represents shared state. Accordingly, modifications affect all command-line argument consumers.
56
+
57
+ </section>
58
+
59
+ <!-- /.notes -->
60
+
61
+ <section class="examples">
62
+
63
+ ## Examples
64
+
65
+ <!-- eslint no-undef: "error" -->
66
+
67
+ ```javascript
68
+ var ARGV = require( '@stdlib/process/argv' );
69
+
70
+ console.log( ARGV );
71
+ // => [...]
72
+ ```
73
+
74
+ </section>
75
+
76
+ <!-- /.examples -->
77
+
78
+ <!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
79
+
80
+ <section class="related">
81
+
82
+ * * *
83
+
84
+ ## See Also
85
+
86
+ - <span class="package-name">[`@stdlib/process/env`][@stdlib/process/env]</span><span class="delimiter">: </span><span class="description">object containing the user environment.</span>
87
+
88
+ </section>
89
+
90
+ <!-- /.related -->
91
+
92
+ <!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
93
+
94
+ <section class="links">
95
+
96
+ <!-- <related-links> -->
97
+
98
+ [@stdlib/process/env]: https://github.com/stdlib-js/process/tree/main/env
99
+
100
+ <!-- </related-links> -->
101
+
102
+ </section>
103
+
104
+ <!-- /.links -->
@@ -0,0 +1,22 @@
1
+
2
+ {{alias}}
3
+ An array containing command-line arguments passed when launching the calling
4
+ process.
5
+
6
+ The first element is the absolute pathname of the executable that started
7
+ the calling process.
8
+
9
+ The second element is the path of the executed file.
10
+
11
+ Any additional elements are additional command-line arguments.
12
+
13
+ In browser environments, the array is empty.
14
+
15
+ Examples
16
+ --------
17
+ > var execPath = {{alias}}[ 0 ]
18
+ e.g., /usr/local/bin/node
19
+
20
+ See Also
21
+ --------
22
+
@@ -0,0 +1,33 @@
1
+ /*
2
+ * @license Apache-2.0
3
+ *
4
+ * Copyright (c) 2019 The Stdlib Authors.
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+
19
+ // TypeScript Version: 4.1
20
+
21
+ /**
22
+ * An array containing command-line arguments passed when launching the calling process.
23
+ *
24
+ * @example
25
+ * console.log( ARGV );
26
+ * // => [...]
27
+ */
28
+ declare const ARGV: Array<string>;
29
+
30
+
31
+ // EXPORTS //
32
+
33
+ export = ARGV;
@@ -0,0 +1,28 @@
1
+ /*
2
+ * @license Apache-2.0
3
+ *
4
+ * Copyright (c) 2019 The Stdlib Authors.
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+
19
+ import ARGV = require( './index' );
20
+
21
+
22
+ // TESTS //
23
+
24
+ // The variable is a string array...
25
+ {
26
+ // eslint-disable-next-line @typescript-eslint/no-unused-expressions
27
+ ARGV; // $ExpectType string[]
28
+ }
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @license Apache-2.0
3
+ *
4
+ * Copyright (c) 2018 The Stdlib Authors.
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+
19
+ 'use strict';
20
+
21
+ // MAIN //
22
+
23
+ var ARGV = [];
24
+
25
+
26
+ // EXPORTS //
27
+
28
+ module.exports = ARGV;
@@ -0,0 +1,40 @@
1
+ /**
2
+ * @license Apache-2.0
3
+ *
4
+ * Copyright (c) 2018 The Stdlib Authors.
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+
19
+ 'use strict';
20
+
21
+ /**
22
+ * An array containing command-line arguments passed when launching the calling process.
23
+ *
24
+ * @module @stdlib/process/argv
25
+ *
26
+ * @example
27
+ * var ARGV = require( '@ohos-ports/stdlib-process/argv' );
28
+ *
29
+ * console.log( ARGV );
30
+ * // => [...]
31
+ */
32
+
33
+ // MODULES //
34
+
35
+ var main = require( './main.js' );
36
+
37
+
38
+ // EXPORTS //
39
+
40
+ module.exports = main;