This file contains hidden or 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
# This is how I've managed to make this work with the least amount of lag time. | |
# load-nvm from NVM checks the node version every time you cd into another directory which causes noticeable delays. | |
# This version will get your current working directory and traverse each directory looking for a `.nvmrc` file until it reaches your current directory. | |
# Once it finds the closest directory with a `.nvmrc` file, it will store that version in a variable `$NVM_VERSION_TO_USE`. | |
# Next is to hook into the preexec hook. If the command you're running starts with yarn, npm, or node (could maybe check others as well - any command that would invoke node), | |
# it will then set the node version using NVM. | |
# Running a yarn command has its own delay (install, test, start, etc.) so the small lag before the yarn command is negligable. | |
# It will also only set the node version once so long as you haven't switched directories, so subsequent invoking of yarn is quick. |
This file contains hidden or 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
{ | |
"name": "online-store", | |
"version": "0.0.0", | |
"license": "MIT", | |
"angular-cli": {}, | |
"scripts": { | |
"ng": "ng", | |
"start": "ng serve", | |
"lint": "tslint \"src/**/*.ts\" --project src/tsconfig.json --type-check && tslint \"e2e/**/*.ts\" --project e2e/tsconfig.json --type-check", | |
"test": "ng test", |