Created
March 3, 2017 09:52
-
-
Save mreis1/83c3f5fc29d7af949afe0cb781e6976e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//form a npm depency list extract the exact version a generate a string for npm install | |
var obj = { "@angular/common": "^2.4.0", | |
"@angular/compiler": "^2.4.0", | |
"@angular/core": "^2.4.0", | |
"@angular/forms": "^2.4.0", | |
"@angular/http": "^2.4.0", | |
"@angular/material": "^2.0.0-beta.1", | |
"@angular/platform-browser": "^2.4.0", | |
"@angular/platform-browser-dynamic": "^2.4.0", | |
"@angular/router": "~3.4.0", | |
"@angular/upgrade": "^2.1.0", } | |
var str = ""; | |
for (var i in obj) { | |
str+= " " + i + '@' + obj[i].replace(/(~|\^)/g,'') | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment