在package.json中,这些带有前缀下划线的属性是什么? [英] What are these properties prefixing underscore used for in package.json?

查看:725
本文介绍了在package.json中,这些带有前缀下划线的属性是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在package.json中发现了这些属性在下划线前加前缀.它们是用来干什么的?为什么在属性上加下划线?

I found these properties prefixing underscore in package.json. What are they used for? why prefixing underscore on properties?

  "_from": "react-scripts@0.9.3",
  "_id": "react-scripts@0.9.3",
  "_inCache": true,
  "_location": "/react-scripts",
  "_nodeVersion": "6.0.0",
  "_npmOperationalInternal": {
    "host": "packages-18-east.internal.npmjs.com",
    "tmp": "tmp/react-scripts-0.9.3.tgz_1488303928068_0.6415497597772628"
  },
  "_npmUser": {
    "name": "gaearon",
    "email": "dan.abramov@gmail.com"
  },

推荐答案

这些是保留给程序包注册表的元数据.所有以_或$开头的属性均保留供软件包注册管理机构使用. 维基百科上常见的保留属性"部分对此进行了解释.

Those are meta data reserved for package registries. All properties beginning with _ or $ are reserved for package registries to use at their discretion. wiki common "Reserved Properties" section explains it.

这篇关于在package.json中,这些带有前缀下划线的属性是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆