A list of terminal commands and flags to help me use npm
Super charge npm
npm config set cache-min 9999999
| // Creating promises | |
| var promise = new Promise(function (resolve, reject) { | |
| resolve('all good') | |
| }) | |
| promise.then(function (result) { | |
| console.log('was it good?', result) | |
| }).catch(function (err) { | |
| console.error('ERR', err) | |
| }) |
The apt-get version of node is incredibly old, and installing a new copy is a bit of a runaround.
So here's how you can use NVM to quickly get a fresh copy of Node on your new Bash on Windows install
$ touch ~/.bashrc
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
// restart bash
$ nvm install --lts| import os | |
| import re | |
| import sys | |
| import requests | |
| filename_matcher = re.compile(r'http://www.oreilly.com/(.*)/free/(.*).csp') | |
| def main(): | |
| categories = sys.argv[1:] | |
| urls = map(lambda x: 'http://www.oreilly.com/{}/free/'.format(x), categories) |
| [ | |
| { | |
| "quoteID": 1, | |
| "quote": "Efforts and courage are not enough without purpose and direction.", | |
| "author": "John F Kennedy", | |
| "description": "35th President of the USA", | |
| "profile": "http://markmcmillion.com/wp-content/uploads/2014/03/JFK-150x150.jpg", | |
| "portrait": "http://bit.ly/1Q6aObg", | |
| "bio": "John F Kennedy was a president of the United States of America" | |
| }, |
| npm install -g rimraf | |
| find . -name "node_modules" -exec rimraf {} \; |
| # Logs | |
| logs | |
| *.log | |
| npm-debug.log* | |
| # Runtime data | |
| pids | |
| *.pid | |
| *.seed |
The following guide will show you how to deploy a simple microservice written in JavaScript using π« now.
It uses Open Source tools that are widely available, tested and understood: