<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                [TOC] # 介紹 文檔:[http://nodejs.cn/api/process.html](http://nodejs.cn/api/process.html) 官方解釋:process 對象是一個 global 全局變量,提供有關信息,控制當前 Node.js 進程。作為一個對象,它對于 Node.js 應用程序始終是可用的,故無需使用 `require()`。 process(進程)其實就是存在 nodejs 中的一個全局變量。 process 內容: ``` $ node process.js process { title: 'node', version: 'v4.4.4', moduleLoadList: [....], versions: { http_parser: '2.5.2', node: '4.4.4', v8: '4.5.103.35', uv: '1.8.0', zlib: '1.2.8', ares: '1.10.1-DEV', icu: '56.1', modules: '46', openssl: '1.0.2h' }, arch: 'x64', platform: 'darwin', release: { name: 'node', lts: 'Argon', sourceUrl: 'https://nodejs.org/download/release/v4.4.4/node-v4.4.4.tar.gz', headersUrl: 'https://nodejs.org/download/release/v4.4.4/node-v4.4.4-headers.tar.gz' }, argv: [ '/Users/tugenhua/.nvm/versions/node/v4.4.4/bin/node', '/Users/tugenhua/個人demo/process.js' ], execArgv: [], env: { TERM_PROGRAM: 'Apple_Terminal', SHELL: '/bin/zsh', TERM: 'xterm-256color', TMPDIR: '/var/folders/l7/zndlx1qs05v29pjhvkgpmhjm0000gn/T/', Apple_PubSub_Socket_Render: '/private/tmp/com.apple.launchd.7Ax4C1EWMx/Render', TERM_PROGRAM_VERSION: '404', TERM_SESSION_ID: '82E05668-442D-4180-ADA3-8CF64D85E5A9', USER: 'tugenhua', SSH_AUTH_SOCK: '/private/tmp/com.apple.launchd.MYOMheYcL3/Listeners', PATH: '/Users/tugenhua/.nvm/versions/node/v4.4.4/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin', PWD: '/Users/tugenhua/個人demo', LANG: 'zh_CN.UTF-8', XPC_FLAGS: '0x0', XPC_SERVICE_NAME: '0', SHLVL: '1', HOME: '/Users/tugenhua', LOGNAME: 'tugenhua', SECURITYSESSIONID: '186a8', OLDPWD: '/Users/tugenhua/工作文檔/sns_pc', ZSH: '/Users/tugenhua/.oh-my-zsh', PAGER: 'less', LESS: '-R', LC_CTYPE: 'zh_CN.UTF-8', LSCOLORS: 'Gxfxcxdxbxegedabagacad', NVM_DIR: '/Users/tugenhua/.nvm', NVM_NODEJS_ORG_MIRROR: 'https://nodejs.org/dist', NVM_IOJS_ORG_MIRROR: 'https://iojs.org/dist', NVM_RC_VERSION: '', MANPATH: '/Users/tugenhua/.nvm/versions/node/v4.4.4/share/man:/usr/local/share/man:/usr/share/man:/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/share/man:/Applications/Xcode.app/Contents/Developer/usr/share/man:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/share/man', NVM_PATH: '/Users/tugenhua/.nvm/versions/node/v4.4.4/lib/node', NVM_BIN: '/Users/tugenhua/.nvm/versions/node/v4.4.4/bin', _: '/Users/tugenhua/.nvm/versions/node/v4.4.4/bin/node', __CF_USER_TEXT_ENCODING: '0x1F5:0x19:0x34' }, pid: 14034, features: { debug: false, uv: true, ipv6: true, tls_npn: true, tls_sni: true, tls_ocsp: true, tls: true }, _needImmediateCallback: false, config: {}, nextTick: [Function: nextTick], _tickCallback: [Function: _tickCallback], _tickDomainCallback: [Function: _tickDomainCallback], stdout: [Getter], stderr: [Getter], stdin: [Getter], openStdin: [Function], exit: [Function], kill: [Function], mainModule: Module { id: '.', exports: {}, parent: null, filename: '/Users/tugenhua/個人demo/process.js', loaded: false, children: [], paths: [ '/Users/tugenhua/個人demo/node_modules', '/Users/tugenhua/node_modules', '/Users/node_modules', '/node_modules' ] } } ``` # `process.env` 官方: `process.env` 屬性返回一個包含用戶環境信息的對象。返回項目運行所在環境的一些信息。 文檔:[process_process_env](http://nodejs.cn/api/process.html#process_process_env) # `process.argv` 命令行參數可通過系統變量`process.argv`獲取。 `process.argv` 返回一個數組:第一個是 node 第二個是腳本文件 第三個是輸入的參數,`process.argv[2]`開始得到才是真正的參數部分。 > [yargs-parser](https://github.com/yargs/yargs-parser) # `process.stdin` `stdout`、`stdin`和`stderr`是標準流(standard streams),當程序執行時,它們連接程序及其環境之間的輸入和輸出通信通道。 流通常指的是數據的流動。你可以把流想象成工廠里的傳送帶,連接著不同的機器(在我們這里是程序)。不同的機器可以以某種方式被安排、引導并與皮帶(管道)連接以產生特定的結果。 就像我們可以連接物理 I/O 設備(通過鼠標輸入,通過監視器輸出)一樣,標準流將其抽象出來,賦予我們代碼的可組合能力。 ![](https://img.kancloud.cn/f7/27/f727d21869a74a24d30da2a7b00697cd_730x361.png) 就像我們可以從小的命令中組合出強大的 Linux 命令一樣,我們可以使用 Node.js 標準流來實現同樣的效果。 當我們運行一個 Node.js 程序時,會啟動一個進程來執行該程序。 [GNU 文檔](https://www.gnu.org/software/libc/manual/html_node/Processes.html)將進程定義為系統資源分配的基本單元。每個進程都有自己的地址空間和(通常)一個控制線程。一個進程意味著執行一個程序;你可以讓多個進程執行同一個程序,但是每個進程在自己的地址空間中都有自己的程序副本,并且獨立于其他副本執行該程序。 每個進程會使用三個打開的文件描述符進行初始化,分別是`stdin`、`stdout`和`stderr`。 這三個文件描述符統稱為標準流。 一個進程啟動時,同時就會有一組標準流,我們可以通過 Node.js 中的 process 對象訪問它們。 標準流被當作文件來處理。訪問任何文件的一種簡單方法是使用與之相關聯的唯一文件描述符。在這些標準流的情況下,每個標準流都有唯一的值。 * [`process.stdin`](https://nodejs.org/api/process.html#processstdin)(0): The standard input stream, which is a source of input for the program * [`process.stdout`](https://nodejs.org/api/process.html#processstdout)(1): The?standard output stream, which is a source of output from the program * [`process.stderr`](https://nodejs.org/api/process.html#processstderr)(2): The?standard error?stream, which is used for error messages and diagnostics issued by the program > [Using stdout, stdin, and stderr in Node.js](https://blog.logrocket.com/using-stdout-stdin-stderr-node-js/) # Nodejs 進程信號 [https://zhuanlan.zhihu.com/p/148538831](https://zhuanlan.zhihu.com/p/148538831) [https://www.jianshu.com/p/7a11ac2a973b](https://www.jianshu.com/p/7a11ac2a973b) # 參考 [node 中的 process 模塊](https://github.com/SunShinewyf/issue-blog/issues/37)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看