Your Choice JavaScript News

Node News Thursday, February 8

Node News TLDR / Table of Contents

  • LeCoupa/awesome-cheatsheets
    • awesome-cheatsheets – đź“š Awesome cheatsheets for popular programming languages, frameworks and development tools. They include everything you should know in one single file.
    • completion callback, possible exception, zlib streams, crypto streams,
  • Node.js + face-recognition.js : Simple and Robust Face Recognition using Deep Learning
    • In this article I am going to show you how to perform robust face detection and face recognition using face-recognition.js. I was looking for a promising Node.js library that produces accurate face…
    • face, face recognition, faces, input face, face recognizer
  • A crash course on Serverless with Node.js –
    • Regardless of your developer background, it’s inevitable you’ve heard the term Serverless in the past year. The word has been buzzing around in my ears for longer than I dare say. For too long have I…
    • Serverless, serverless offline, serverless architecture, Serverless framework, serverless applications
  • How I Got Into #Node: Uttam Pawar – Node.js Collection –
    • After a frustrating experience at a startup, Uttam Pawar (a software engineer at Intel) decided to learn more about web and mobile development and got into Java, Flex, Rails(RoR) and eventually…
    • Node.js, Node.js runtime, , ,
  • How to Test NodeJS Apps using Mocha, Chai and SinonJS
    • Not having tests in your app is a pain because, chances are every time you make slight adjustments to your app you have to manually check every single part of your app to see if anything broke. Writing tests however, also feels for the most part a chore. But we…
    • tests, function, spies, ,
  • How to Build a Simple Web Server with Node.js —
    • Jonathan Wexler walks through the steps for installing Node.js, and shows how to build a Node.js module and jump right in to initializing a web server.
    • Node.js, web server, application, ,
  • Node Weekly Issue 224: February 8, 2018
    • quick-fire code snippets, single source file, Node developers, biggest problems, fs methods

Score: 2306.3869805437357
URL: https://github.com/LeCoupa/awesome-cheatsheets/blob/master/backend/node.js
Tweeted At: Thu Feb 08 19:48:12 +0000 2018
Publish Date:
Author: LeCoupa

  • The top-level scope is not the global scope; var something inside a Node module will be local to that module.
  • unref(); // Allow you to create a timer that is active but if it is the only item left in the event loop, node won’t keep the program running.
  • exports.area = function (r) { – – – – return Math.PI * r * r; – – – – }; – – – – – – – – – // If you want the root of your module’s export to be a function (such as a constructor) – – -…
  • module.exports = function(width) { – – – – return { – – – – area: function() { – – – – return width * width; – – – – } – – – – }; – – – – } – – – – – – – – – -…
  • process.config; // An Object containing the JavaScript representation of the configure options that were used to compile the current node executable.

Tags: completion callback, possible exception, zlib streams, crypto streams,

Score: 1310.2454044489384
URL: https://medium.com/@muehler.v/node-js-face-recognition-js-simple-and-robust-face-recognition-using-deep-learning-ea5ba8e852
Tweeted At: Fri Jan 26 12:18:46 +0000 2018
Publish Date: 2018-01-09T21:28:31.110000+00:00
Author: Vincent MĂĽhler

  • js : Simple and Robust Face Recognition using Deep LearningThe npm package for face recognitionTrained to recognize faces of Raj, Sheldon, Lennard and HowardIn this article I am going to show you how to perform robust face detection and face recognition using face-recognition.
  • js I wanted to provide an npm package whichexposes a simple API to get started quicklystill allows for more fine grain control if desiredis easy to set up (optimally as simple as typing npm install)While this package is still work in progress, right now you can do the following stuff…
  • The code of this example can be found on the repo.Preparing the dataI have collected roughly 20 faces per character in different poses:We will use 10 faces each to train the recognizer and the rest to evaluate the accuracy of our recognizer:The file name of each face image contains the persons…
  • Increasing the number of jittered version may increase prediction accuracy but also increases training time.Furthermore, we can store the recognizers state, so that we do not have to train it again the next time and we can simply load it from a file:Save:Load:Recognizing new facesNow we can check the prediction accuracy…
  • The output will look somehow like this:{ className: ‘sheldon’, distance: 0.5 }In case you want to obtain the distances of the face descriptors of all classes to an input face you can simply use recognizer.predict(image), which will output an array with the distance for each class:[ { className: ‘sheldon’, distance:…

Tags: face, face recognition, faces, input face, face recognizer

Score: 1235.5588388651206
URL: https://hackernoon.com/a-crash-course-on-serverless-with-node-js-632b37d58b44?gi=924b91523756
Tweeted At: Mon Feb 05 17:00:12 +0000 2018
Publish Date: 2017-10-04T15:50:55.806000+00:00
Author: Adnan Rahić

  • Lastly we’ll go ahead and jump right into some code and write our own Serverless functions, emulate the environment locally and monitor performance!
  • You would usually create an app.get() method for a particular route, like this:app.get(‘/’, function(req, res, next) { /* execute some code */ });When a user hits the ‘/’ route an event will trigger the callback function.
  • The only downside is that you have to push code to AWS every time you wish to test your functions, while emulating the environment locally is a bit of pain.The use cases when Serverless is the better choice are vast.
  • Create your first serviceCreate a new directory to house your Serverless application services.
  • It’s where you define AWS Lambda Functions, the events that trigger them and any AWS infrastructure resources they require, all in a file called serverless.yml.Back in your terminal type:$ serverless create –template aws-nodejs –path my-serviceThe create command will create a new service.

Tags: Serverless, serverless offline, serverless architecture, Serverless framework, serverless applications

Score: 352.6575674023822
URL: https://medium.com/the-node-js-collection/how-i-got-into-node-uttam-pawar-4c62d3840a78
Tweeted At: Thu Feb 08 22:01:12 +0000 2018
Publish Date: 2018-02-08T18:17:29.149000+00:00
Author: Node.js Foundation

  • How I Got Into #Node: Uttam PawarAfter a frustrating experience at a startup, Uttam Pawar (a software engineer at Intel) decided to learn more about web and mobile development and got into Java, Flex, Rails(RoR) and eventually Node.js.Uttam now contributes regularly to Node.js and is focused on the platform for his…
  • So around 2013, I decided to learn about web and mobile development and tried Java, Flex, Rails(RoR) and Node.js.What intrigued you about Node.js or what prompted you to use it?My first good experience with web development was using the RoR platform.
  • I’ve been at Intel as a software engineer since 2012 working on various software stacks such as Android, PHP, JavaScript, Go and Node.js runtime optimizations.As a performance engineer, I wanted to measure performance of the Node.js runtime on Intel platforms with various other platforms, but there were no standard benchmarks…
  • So I started attending the Node.js Benchmark Working Group meetings, and connected with people who also are interested in performance.I proposed having a standard workload to address various use cases of Node.js, such as very common single instances and multi-processes via the use of Cluster.js and a microservice model.
  • The process includes forking the project, cloning it, creating a working branch, making change(s), build, test, etc.You can also look into individual software components of Node.js such as Google’s V8 or Microsoft’ Chakra JavaScript Engine, libuv library, openssl library if you are interested in getting more involved.How do you use…

Tags: Node.js, Node.js runtime, , ,

Score: 104.75162405778896
URL: https://scotch.io/tutorials/how-to-test-nodejs-apps-using-mocha-chai-and-sinonjs
Tweeted At: Mon Feb 05 16:20:01 +0000 2018
Publish Date: 2018-02-05T08:00:00+00:00
Author: Joy Warugu

  • const chai = require(“chai”); – const expect = chai.expect; – // import our getIndexPage function – const indexPage = function() { – it(“should return index page”, function() { – let req = {} – // Have `res` have a send key with a function value coz we use `res.send()` in…
  • const chai = require(“chai”); – const expect = chai.expect; – // import sinon – const sinon = require(“sinon”); – const indexPage = function() { – it(“should return index page”, function() { – let req = {} – // Have `res` have a send key with a function value coz we…
  • Let’s go ahead and make some of these assertions: – – We’ll expect that our function res.send is called once – We’ll expect that we get an argument Hey on the firstCall – – const chai = require(“chai”); – const expect = chai.expect; – // import sinon – const sinon…
  • We can simulate this scenario by defining a simple function like so: – const chai = require(“chai”); – const expect = chai.expect; – // import sinon – const sinon = require(“sinon”); – const indexPage = user = { – addUser: (name) = { – this.name = name; – } -…
  • const chai = require(“chai”); – const expect = chai.expect; – // import sinon – const sinon = require(“sinon”); – const indexPage = user = { – addUser: (name) = { – this.name = name; – } – } – – … – – describe(“User”, function() { – describe(“addUser”, function() {…

Tags: tests, function, spies, ,

Score: 89.0735599826765
URL: https://www.sitepoint.com/build-a-simple-web-server-with-node-js/
Tweeted At: Thu Feb 08 08:35:55 +0000 2018
Publish Date: 2018-01-22T17:00:39+00:00
Author:

  • NOTE: When you install Node.js, you also get npm, the Node.js ecosystem of external libraries (multiple files of code other people wrote) that can be imported into your future projects.
  • Luckily for us, the answer is no, npm can be used to install Node.js packages, libraries of code others have written that you can use to add specific features to your application.
  • Creating a Node.js Module – A Node.js application is ultimately made up of many JavaScript files.
  • Running npm Commands – With your installation of Node.js, you also got Node Package Manager (npm).
  • Initializes a Node.js application and creates a package.json file – npm install package.

Tags: Node.js, web server, application, ,

Score: 188.4549758177938
URL: https://nodeweekly.com/issues/224
Tweeted At: Thu Feb 08 17:23:00 +0000 2018
Publish Date:
Author:

    Tags: quick-fire code snippets, single source file, Node developers, biggest problems, fs methods

    Top Node Courses

    The Complete Node.js Developer Course (2nd Edition) (60,232 students enrolled)

    By Andrew Mead
    • Build, test, and launch Node apps
    • Create Express web servers and APIs
    • Store data with Mongoose and MongoDB
    • Use cutting-edge ES6/ES7 JavaScript
    • Deploy your Node apps to production
    • Create real-time web apps with SocketIO

    Learn more.


    Angular (Angular 2+) & NodeJS - The MEAN Stack Guide (26,806 students enrolled)

    By Maximilian SchwarzmĂĽller
    • Build real Angular + NodeJS applications
    • Understand how Angular works and how it interacts with Backends
    • Connect any Angular Frontend with a NodeJS Backend
    • Use MongoDB with Mongoose to interact with Data on the Backend
    • Use ExpressJS as a NodeJS Framework
    • Provide a great user experience by using Optimistic Updating on the Frontend
    • Improve any Angular (+ NodeJS) application by adding Error Handling

    Learn more.