/** 在 js 中对于文件而不是注释意味着什么

What does /** means in js with respect to files, and not to comments

我一直卡在代码中,无法找到 /** common to package.json files 字段的含义。 例如。这里

"files":[
          "./*",
          "./**",
          "icon.*"
]

我无法知道上述代码中文件的任何元素的含义取自 package.json

这些被称为 globs,例如参见 [​​=14=]:

  • * Matches 0 or more characters in a single path portion
  • ** If a "globstar" is alone in a path portion, then it matches zero or more directories and subdirectories searching for matches. It does not crawl symlinked directories.

老实说,不确定是谁首先创建了它们。

编辑:实际上,来自 Wiki

The glob command, short for global, originates in the earliest versions of Bell Labs' Unix.

它的目录通配符:

./* - 当前目录中的任何文件。

./** - 当前目录和子目录中的任何文件。

icon.* - 任何名称为 icon.

的文件

从 NPM 文档中阅读有关 package.json 的更多信息