Your Choice JavaScript News

Node News Thursday, March 8 Docker hub registry, Basic docker terminology, Native node.js modules & more…

Node News TLDR / Table of Contents

  • Dockerising a Node.js and MongoDB App – Statuscode –
    • I will run through some basic Docker terminology and concepts and then use a Node.js and MongoDB application that I previously built and demonstrate how to run this in a Docker container. This allows…
    • Docker Hub registry, basic Docker terminology, official Docker Hub, Docker Compose, Docker container
  • Writing Native Node.js Modules | @RisingStack
    • This article explains how native Node.js modules work, and how you can use them to increase the performance of your application.
    • native node.js modules, JavaScript, native extensions, nan, NaN header file
  • Rawnly/zippyshare-extractor
    • GitHub is where people build software. More than 28 million people use GitHub to discover, fork, and contribute to over 80 million projects.
    • Custom download function., file, import zippy, superfluous ones, download url
  • A quick overview of containers and why we would want to use them: – Containers such as Docker let us package up entire applications, including the applications libraries, dependencies, environment and everything else needed by the application to run.Source: DockerSo we can think of containers as portable, packaged bits of…
  • To create a Docker container, we will use a Docker image, and to build a Docker image, we will use a Dockerfile.
  • To run this application in a Docker container, we will write a Dockerfile using the official node image from the Docker Hub registry.
  • instructing Docker to restart the container automatically if it fails,building the app image using the Dockerfile in the current directory andmapping the host port to the container port.We then add another service called mongo but this time instead of building our own mongo image, we simply pull down the standardmongo…
  • For persistent storage, we mount the host directory /data (this is where the dummy data I added when I was running the app locally lives) to the container directory /data/db, which was identified as a potential mount point in the mongo Dockerfile we saw earlier.

Tags: Docker Hub registry, basic Docker terminology, official Docker Hub, Docker Compose, Docker container

  • There are times when the performance of JavaScript is not enough, so you have to depend more on native Node.js modules.
  • In our example code, we have access to the arguments the function was called with (from JavaScript), via the object that also provides us with all of the call related information.
  • As long as we are in the scope of the C++ world, we are free to use the ones built into C++, but when we’re dealing with JavaScript objects and interoperability with JavaScript code, we have to transform C++ types into ones that are understood by the JavaScript context.
  • To maintain compatibility with existing JavaScript code, we have to throw some error if the arguments type is wrong.
  • This is how you create native bindings to Node.js and bridge it to JavaScript code.

Tags: native node.js modules, JavaScript, native extensions, nan, NaN header file

  • It all started when I had to download a file divided into 150 files all from zippyshare, as long as they were 2/3 you could do it.
  • So once I understand how zippyshare protects itself from requests it was simple.
  • This module analyzes the code in the page and runs a script integrated into the zippyshare page which generates a link to the file to be downloaded.
  • This script should self-execute when a user access to the page but no browser no runs.
  • So the solution was to clean the page from all the ADS scripts and other superfluous ones and extract the line that generates the path to the file that needs to be downloaded, then thanks to the function you can easily run it and get the file path.

Tags: Custom download function., file, import zippy, superfluous ones, download url

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.