Your Choice JavaScript News

Node News Friday, February 9

Node News TLDR / Table of Contents

  • Modernizing Node.js with idiomatic JavaScript – Node.js Collection –
    • This blog post was written by Peter Marshall, Software Engineer at Google, V8 and Arunesh Chandra, Sr. Program Manager at Microsoft, Chakra Until recently, it was hard to write JavaScript that worked…
    • JavaScript, developers, code, JavaScript virtual machines, performance
  • Build a JavaScript Command Line Interface (CLI) with Node.js —
    • Lukas White and Michael Wanyoike show how to create a simple command-line app that interacts with the GitHub API to initialize Git repositories.
    • command line, GitHub repo, file, code, powerful command-line tools
  • 59023g/docker-nginx-letsencrypt-upstream
    • docker-nginx-letsencrypt-upstream – infrastructure: docker-compose config for node and redis behind nginx ( SSL/HTTPS ) on debian jessie
    • Docker compose config, huge Docker fan, proxy upstream node, Google Chrome, latest Safari
  • Introduction to the Node.js Community Committee and Our Focus for 2018
    • Hello! My name is Olivia Hugger, and I’m a member of the Node.js Foundation Community Committee. What’s the Community Committee? Well, that’s what I’ll be discussing in this blog through an overview…
    • Node.js, Community Committee, End User Feedback, project, Node.js project
  • An Exhaustive Guide to Writing Dockerfiles for Node.js Web Apps
    • Step by step guide to writing highly optimized Dockerfiles for Node.js web app development and deployment. Covers adding hot reloading, serving static files and using multi-stage alpine builds.
    • docker, Node.js Docker Best, nginx docker, node express server,
  • Chiccocoin: Learn what is a Blockchain by creating one in NodeJS
    • Every day on our feeds we find news about new cryptocurrency or someone who says that they are a big bubble that will soon explode and of which only the blockchain will remain. But, what is the…
    • blockchain, block, previous block, previous block hash,

Score: 1162.975880819367
Tweeted At: Tue Feb 06 13:45:11 +0000 2018
Publish Date: 2018-01-29T17:07:09.090000+00:00
Author: Node.js Foundation

  • In other words, if developers want to improve the performance of their JavaScript, what sort of code should they write?In the past, performance advice was often presented as anti-patterns, for example “Don’t use for-each” or “Don’t use try-catch”.
  • For much of its life, Node.js embedded the V8 engine as the only option to run JavaScript code.
  • Fast-forward to 2018 — Node.js can now also be powered by the ChakraCore JavaScript engine and V8 has a new optimizing compiler Turbofan, both of which have a very different performance profile to Crankshaft.
  • The answer is straightforward: JavaScript developers should focus on writing idiomatic, readable and maintainable code and not focus on the compilers underneath.
  • Ideally, developers should not have to worry about any of those micro-optimizations, instead they should be able to write something much simpler like the following, and trust that the compiler will do the right thing for performance:We believe that instead of developers specializing their JavaScript code for the compilers, compiler…

Tags: JavaScript, developers, code, JavaScript virtual machines, performance

Score: 963.5881006133299
Tweeted At: Mon Feb 05 11:00:52 +0000 2018
Publish Date: 2018-02-02T00:05:30+00:00

  • For example, as part of a typical workflow, you may well: – initialise the local repository by running git init – create a remote repository, for example on GitHub or Bitbucket — typically by leaving the command line and firing up a web browser – add the remote – create…
  • Here’s a complete list of the packages we’ll use specifically for developing on the command line: – chalk — colorizes the output – clear — clears the terminal screen – clui — draws command-line tables, gauges and spinners – figlet — creates ASCII art from text – inquirer — creates…
  • Additionally, we’ll also be using the following: – @octokit/rest — a GitHub REST API client for Node.js – lodash — a JavaScript utility library – simple-git — a tool for running Git commands in a Node.js application – touch — a tool for implementating the Unix touch command.
  • You don’t have to call it ginit, of course: – mkdir ginit – cd ginit – – Create a new package.json file: – npm init – – Follow the simple wizard, for example: – name: (ginit) – version: (1.0.0) – description: “git init” on steroids – entry point: (index.js) -…
  • /index.js” – }, – “dependencies”: { – “@octokit/rest”: “^14.0.5”, – “chalk”: “^2.3.0”, – “clear”: “0.0.1”, – “clui”: “^0.3.6”, – “configstore”: “^3.1.1”, – “figlet”: “^1.2.0”, – “inquirer”: “^5.0.1”, – “lodash”: “^4.17.4”, – “minimist”: “^1.2.0”, – “simple-git”: “^1.89.0”, – “touch”: “^3.1.0” – } – } – – Now create an index.js file…

Tags: command line, GitHub repo, file, code, powerful command-line tools

Score: 1588.310273868082
Tweeted At: Fri Feb 09 14:55:05 +0000 2018
Publish Date:

  • Docker compose config for proxy upstream node servers behind SSL ( Let’s Encrypt ) Nginx on Debian Jessie.
  • Personally I am not a huge Docker fan and err on the side of bash scripts and/or Lambda, but this may be valuable to you.

Tags: Docker compose config, huge Docker fan, proxy upstream node, Google Chrome, latest Safari

Score: 319.43379856418926
Tweeted At: Fri Feb 09 16:02:00 +0000 2018
Publish Date: 2018-01-31T18:00:31.279000+00:00
Author: Node.js Foundation

  • We’re a top-level committee (meaning on the same hierarchical level as the Technical Steering Committee) that’s tasked with everything outward facing and related to work that needs to be done on the community side of the Node.js project.
  • Basically, if the TSC is responsible for the code side of the project, then we’re responsible for the community side.We mainly focus on interacting with our community and helping it grow, as well as engaging with underrepresented groups and figuring out the best ways for folks to get started with…
  • There’s already a fairly detailed plan drawn up to kick this back into gear, and I hope that 2018 will be the year where the entirety of Node.js will first be translated.Website Redesign: We Are Listening to You :)Another really exciting project we’re working on is the redesign of the…
  • These groups intend to get meaningful feedback in order to improve Node.js Core software and also the community itself.Mentorships: Building Our Contributors and Node.js UsersSomething we’ve been working on in 2017 too that I think will really see the light of day this year is project-organized mentoring/learning efforts.
  • Experienced contributors to the Node.js project help guide you through your first few commits to Node.js core — it’s a great way to get confident with contributing and meet a lot of cool folks working with Node.js.As a part of this too, we want to re-launch NodeTogether, a series of free meetups…

Tags: Node.js, Community Committee, End User Feedback, project, Node.js project

Score: 193.2663761151079
Tweeted At: Thu Feb 08 15:54:20 +0000 2018
Publish Date: 2018-02-07T13:18:51.883000+00:00
Author: Praveen Durairaj

  • Using nodemon for hot reloading during development.Optimising for Docker cache layers — placing commands in the right order so that npm install is executed only when necessary.Serving static files (bundles generated via React/Vue/Angular) using serve package.Using multi-stage alpine build to reduce final image size for production.
  • Simple Dockerfile ExampleFor the base image, we have used the latest LTS versionnode:carbonDuring image build, docker takes all files in the context directory.
  • If any files change, nodemon will automatically restart your node application.We’ll build the image and run nodemon so that the code is rebuilt whenever there is any change inside the app directory.
  • OptimisationsIn your Dockerfile, prefer COPY over ADD unless you are trying to add auto-extracting tar files, according to Docker’s best practices.Bypass package.json ‘s start command and bake it directly into the image itself.
  • Assuming you are building a UI app using React/Vue/Angular, you would ideally build your final bundle using npm run build which would generate a minified JS and CSS file.The other alternative is to either 1) build the files locally and use an nginx docker to serve these static files or…

Tags: docker, Node.js Docker Best, nginx docker, node express server,

Score: 70.18058651661076
Tweeted At: Fri Feb 09 07:47:28 +0000 2018
Publish Date: 2018-02-07T16:09:17.150000+00:00
Author: Riccardo Canella

  • Create the blockchainNow we’re going to create our blockchain.Rereading the definition of blockchain we can summarize that the absolutely necessary functions are:newBlock: Function that creates a new blocknewTransaction: Function that creates a transaction and queues it to be saved the next time a block is createdhash: Function that encrypts a…
  • The function also will add to the block all the transactions that have not yet been saved and clean up our variable current_transactions3.1.1 Hash functionThe hash function that uses for our Chiccocoin is a trivial SHA256 but you can use the hash function that you prefer.
  • The important thing is to do the hash of the previous block, to do this we will do the hash of the serialized object3.2 Create a transactionThe function to add a new transaction is very trivial.
  • The Proof of WorkIn general, the proof of work is a function or a protocol invented and used to deter denial of service attacks, but the blockchain used it to determinate how new Blocks are created or mined on themselves.
  • Serve over APIHaving started the project with expressjs serving our blockchain via API will be very simple.We’ll create three API:/transactions/new to create a new transaction to a block/mine to tell our server to mine a new block.

Tags: blockchain, block, previous block, previous block hash,

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.

Comments are closed, but trackbacks and pingbacks are open.