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:
- Node.JS
- NPM
- Express
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:
ES6 introduced a new protocol for constructing instances, but its features (incl. new.target) work in both classes and traditional functions. These are the differences between traditional functions and classes:
Traditional functions can’t make superconstructor calls via super(). That means that they are always base classes. In ES5, superconstructors are called as functions.
The prototype of traditional functions and base classes is Function.prototype. The prototype of a derived class is its superclass.
Classes can’t be function-called. An exception is thrown if you do.
| use Illuminate\Foundation\Http\Kernel as HttpKernel; | |
| use Illuminate\Pipeline\Pipeline; | |
| class Kernel extends HttpKernel | |
| { | |
| /** | |
| * The application's global HTTP middleware stack. | |
| * | |
| * @var array | |
| */ |
This is a rough overview of the options for deploying ES6 to current JavaScript environments. Not everything can be combined with everything:
| /* | |
| $ npm install request | |
| $ node bench.js | |
| */ | |
| var request = require('request'); | |
| var url = 'http://www.google.com'; | |
| var total_requests = 100; | |
| var i; |
While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.
Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.
| function Template(str, data) { | |
| return str.replace(/\${([^}]+)}/g, (_, name) => data[name]); | |
| } | |
| var answer = 42; | |
| (function () { | |
| var answer = 60; | |
| console.log(Template('Answer is ${answer}', {answer})); | |
| })(); |
This let's me git clone a template repo, cd into and fire up a new template in my editor of choice:
$ clone starter # clones https://github.com/addyosmani/starter (a personal boilerplate)
$ clone h5bp html5-boilerplate # get me HTML5 Boilerplate
$ clone angular angular-seed # same for AngularJS seed
$ clone polymerlabs seed-element # same for a new Polymer element