阿西河

所有教程

公众号
🌙
阿西河前端的公众号

我的收藏

    最近访问  (文章)

      教程列表

      抓包专区
      测试专区

      Node.js process.allowedNodeEnvironmentFlags

      Node.js process.allowedNodeEnvironmentFlags

      新增于: v10.10.0

      The process.allowedNodeEnvironmentFlags property is a special, read-only Set of flags allowable within the NODE_OPTIONS environment variable.

      process.allowedNodeEnvironmentFlags extends Set, but overrides Set.prototype.has to recognize several different possible flag representations. process.allowedNodeEnvironmentFlags.has() will return true in the following cases:

      • Flags may omit leading single (-) or double (–) dashes; e.g., inspect-brk for –inspect-brk, or r for -r.
      • Flags passed through to V8 (as listed in –v8-options) may replace one or more non-leading dashes for an underscore, or vice-versa; e.g., –perf_basic_prof, –perf-basic-prof, –perf_basic-prof, etc.
      • Flags may contain one or more equals (=) characters; all characters after and including the first equals will be ignored; e.g., –stack-trace-limit=100.
      • Flags must be allowable within NODE_OPTIONS.

      When iterating over process.allowedNodeEnvironmentFlags, flags will appear only once; each will begin with one or more dashes. Flags passed through to V8 will contain underscores instead of non-leading dashes:

      process.allowedNodeEnvironmentFlags.forEach((flag) => {
        // -r
        // --inspect-brk
        // --abort_on_uncaught_exception
        // ...
      });
      

      The methods add(), clear(), and delete() of process.allowedNodeEnvironmentFlags do nothing, and will fail silently.

      If Node.js was compiled without NODE_OPTIONS support (shown in process.config), process.allowedNodeEnvironmentFlags will contain what would have been allowable.


      更多内容请参考:Node.js process 进程,或者通过 点击对应菜单 进行查看;


      目录
      本文目录
      目录