npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

Support for Variables in package.json

I would like to use custom variables in my package.json
Example of the envisioned package.json:

  "name": "app-ui",
  "version": "1.0.0",
  "license": "MIT",
  "variables": {
   "angularVersion": "^4.0.2"
  "dependencies": {
    "@angular/common": "${angularVersion}",
    "@angular/compiler": "${angularVersion}",
    "@angular/core": "${angularVersion}",
    "@angular/forms": "${angularVersion}",
    "@angular/http": "${angularVersion}",
    "@angular/platform-browser": "${angularVersion}",
    "@angular/platform-browser-dynamic": "${angularVersion}",
    "@angular/router": "${angularVersion}",
    "core-js": "^2.4.1",
    "hammerjs": "^2.0.8",
    "rxjs": "^5.1.0",
    "zone.js": "^0.7.6"
  "devDependencies": {
    "@angular/cli": "^1.0.0",
    "@angular/compiler-cli": "${angularVersion}",
    "@types/jasmine": "2.5.38",

Also see those issues from the archives:

I like this idea but it would no longer follow the .json spec defined by IETF currently.
or the json schema defined:

Interesting point to note is json pointers are being submitted for proposal which could satisfy this use case: