package.json文件中的自定义属性?

时间:2018-10-02 01:29:00

标签: node.js npm package.json

我是npm的新手,我发现很难理解package.json文件。 我在package.json文件中遇到以下属性:

{
  "name":
  "version":
  "author": {},
  "config": {
    "port": "8081"
  },
  "scripts": {
      build: "abc"
  },
  "lint-staged": {
    "*": [
      "npm run lint",
      "git add"
    ]
  },
  "private": true,
  "repository": {
    "type": "git",
    "url": "url"
  },
  "engines": {
    "node": "8.x.x"
  },
  "deployment": {
    "command": "node dist/server",
    "name": "abc",
    "protectedresources": "/",
    "protectedresourcesAllowPolicyFilter": "policy",
    "unprotectedresources": "/pkg",
    "accessdenyRedirect": "pkg/1.0.0/web/access-denied.html",
    "type": "internal",
    "organization": "",
    "privateCloud": "",
    "publicCloud": "",
    "properties": {
      "local": {
        "env": {
          "//": "// * NOTE :: DEFINE ENV VARIABLES HERE, ALSO ADD TO environment.common.ts //",
          "LOGGER_IMPL": "console",
          "NODE_ENV": "development",
          "RTE": "local",
          "baseHref": "/",
          "internalOnPremServiceDomain": "url",
          "internalServiceDomain": "url",
          "accountsWebService": "aaaa",
          "globalHeaderDomain": "abcccc.aacontent.info"
        }
      },
      "test-us-east-1": {
        "env": {
          "AWS_DEPLOYMENT": true,
          "LOGGER_IMPL": "console",
          "NODE_ENV": "development",
          "internalOnPremServiceDomain": "url",
          "internalServiceDomain": "url",
          "accountsWebService": "aaaa",
          "baseHref": "url",
          "globalHeaderDomain": "abcccc.aacontent.info"
        }
      }
    },
    "sonar": {
      "profile": "software-improvement-group",
      "language": "js",
      "sources": "src",
      "tests": "src",
      "testsInclusions": "**/*.spec.ts",
      "exclusions": "**/*.js",
      "lcovReportPath": "reports/coverage/lcov.info"
    }
  },
  "dependencies": {},
  "devDependencies": {}
}

我知道常规属性,例如脚本 依赖关系和devDependencies。

我对其他属性(例如部署(及其内部的属性),皮棉级,声纳等)的怀疑。我将如何在项目中使用这些属性/配置? npm run build将运行构建过程,但不确定其他属性。

我没有找到适合此类属性的文档。这些属性是针对项目定制的吗?

0 个答案:

没有答案