node.js - 如何列出 curdir 中的文件不被 npm 的 .gitignore 和 .npmignore 忽略

标签 node.js npm gitignore

如何查看当前目录下npm publish要发布的文件列表,换句话说,那些没有被 .gitignore 的忽略规则忽略的文件和 .npmignore .

我希望有一个特定的命令行或 Node.js 模块/函数可以完成这项工作。

最佳答案

我不知道这是否真的有帮助,但看看 package.jsonfiles 字段 <强> https://docs.npmjs.com/files/package.json#files

package.jsonfiles 字段中,您可以指定要发布的文件。

我认为您在 files 字段中包含的内容将覆盖任何 .gitignore 规则,但不会覆盖 .npmignore 规则。不过我不确定。

关于node.js - 如何列出 curdir 中的文件不被 npm 的 .gitignore 和 .npmignore 忽略,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32906557/

相关文章:

javascript - Webpack - 没有输出文件,没有错误报告

node.js - 使用 typescript 创建 Node 模块,并将其作为依赖项导入 : Duplicate identifier (TS2300)

node.js - 在 NodeJS 中生成的 ffmpeg 不会输出到 url

angular - 为什么每次创建新的 angular 2 项目时都必须运行 npm install?

git - Visual Studio cmake 的 .gitignore - 我应该忽略哪些文件?

eslint no-restricted-imports - 防止从以模式结尾的路径导入

javascript - 如何从被拒绝的外部 “throw”博克处理的被拒绝的 promise 中,如何在 “catch”方法内 “catch”?

node.js - 通过 GIT 安装私有(private) NPM 模块并更新?

javascript - 抛出新错误(`弃用通知 : CommonsChunkPlugin now only takes a single argument

node.js - package-lock.json 也应该发布吗?