node.js package.json 中属性“private”的用途是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7314849/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 14:32:35  来源:igfitidea点击:

What is purpose of the property "private" in package.json?

node.jspackage.json

提问by CarlLee

I'm learning node.js and express, I am wondering what is the property "private" in ./package.json file used for?

我正在学习 node.js 和 express,我想知道 ./package.json 文件中的属性“private”是干什么用的?

回答by ace

Taken from this site, https://docs.npmjs.com/files/package.json#private

取自此站点,https://docs.npmjs.com/files/package.json#private

private

If you set "private": true in your package.json, then npm will refuse to publish it.

This is a way to prevent accidental publication of private repositories.

private

如果你在 package.json 中设置了 "private": true,那么 npm 将拒绝发布它。

这是一种防止意外发布私有存储库的方法。