background preloader

Guides

Facebook Twitter

Node.js в бою (создание кластера) Когда вы используете приложения на node.js в продакшене, вам приходится задумываться о стабильности, производительности, безопасности и удобстве поддержки.

Node.js в бою (создание кластера)

Данная статья описывает мои мысли о лучших практиках использования node.js в бою. К окончанию данного руководства вы получите систему из 3 серверов: балансировщик (lb) и 2 сервера приложений (app1 и app2). Искусство командной строки / Хабрахабр. 9 июля в 05:56 Вот уже как неделю английская версия the art of command line висит в секции trending на Github.

Искусство командной строки / Хабрахабр

Для себя я нашел этот материал невероятно полезным и решил помочь сообществу его переводом на русский язык. В переводе наверняка есть несколько недоработок, поэтому милости прошу слать пулл-реквесты мне сюда или автору оригинальной работы Joshua Levy вот сюда. (Если PR отправите мне, то я после того, как пересмотрю изменения отправлю их в мастер-бранч Джоша). Пишем быстрый и экономный код на JavaScript.

Такой движок JS, как V8 (Chrome, Node) от Google, заточен для быстрого исполнения больших приложений.

Пишем быстрый и экономный код на JavaScript

Если вы во время разработки заботитесь об эффективном использовании памяти и быстродействии, вам необходимо знать кое-что о процессах, проходящих в движке JS браузера. Задайте себе вопрос: — можно ли что-то в моём коде сделать более эффективным? — какую оптимизацию проводят популярные движки JS? — что движок не может компенсировать, и может ли сборка мусора подчистить всё так, как я от неё ожидаю? A Compendium of Hooks in EmberCLI - The Hashrocket Blog. Below you'll find information relevant to creating addons in EmberCLI.

A Compendium of Hooks in EmberCLI - The Hashrocket Blog

Addons are a powerful abstraction in EmberCLI. These addons help enable the extension of Ember applications built with the framework. EmberCLI has several generators that make creating addons simple, but knowing where to put your addon specific customizations can be difficult. This post will attempt to list all known addon hooks as of EmberCLI version 0.1.4. Table of Contents: For each hook we'll cover the following (if applicable): Received argumentsSourceDefault implementationUsesExamples Compendium is largely based of a talk by @rwjblue which can be found here Config. Building a RESTful API in Node using hapi.js 8.0 – Rafael Corral.

Getting started with hapi 8 - tutorial. A rich framework for building applications and services hapi enables developers to focus on writing reusable application logic instead of spending time building infrastructure. hapi is currectly being used by companies like Walmart (not just used but actively developed and maintained), Yahoo, PayPal or Mozilla - even the new npmjs website is built using it.

Getting started with hapi 8 - tutorial

Starting your first server Before dive into it, make sure that your are using version 8 of hapi, as some API calls are different in previous versions. Installing hapi You can grab the latest version of hapi from NPM: npm install hapi --save Launch the hapi-ness Let's take a closer look on what is happening here! First, we create a new hapi instance.Then our connection is defined - it is important, because in hapi you can define more, not just one. Diving deeper To be able to use hapi's full power we have to understand some of the key features/mechanisms of hapi: lifecycle of a requestpluginsserver methods.

Manifests, plugins and schemas: Organizing your Hapi application. Creating Multiplatform Precompiled Binaries for Node.js Modules. It is always a high priority here at The Hybrid Group to make Cylon.js, and all of the various Node.js modules that it depends on, easier to install and use.

Creating Multiplatform Precompiled Binaries for Node.js Modules

Using some of the coolest npm modules for developing JavaScript robotics like node-serialport, node-opencv and gamepad often require compiling native extensions. Some of those modules also require platform specific native dependencies and libraries for OSX, Linux, or Windows. This requires that the user of the modules have a development environment for compiling native code, and that is also is up to date, which is not always the case. We have come across this issue quite often, since several Cylon modules also have dependencies for these same npm modules.

It is especially difficult when doing a workshop or hackathon, when many attendees do not have all the dependencies required to compile these native extensions. Setup and Auto-Generate the Binary Packages. Debugging Node.js. S Blog. Folder Structure for Single Page Applications. July 7, 2014 It makes me sad to see so many people still use old, archaic folder structure for their projects.

Folder Structure for Single Page Applications

It seems that while front-end development has moved light years ahead, the structure people use did not change since the 90x. The general principle of folder structure in 90x was organization by type, something like this: Using Node.js in Production. By Jeff Dickey When running a node application in production, you need to keep stability, performance, security, and maintainability in mind.

Using Node.js in Production

In this article, I’ll outline what I think are the best practices for putting Node.js into production. By the end of this guide, this setup will include 3 servers: a load balancer (lb) and 2 app servers (app1 and app2). The load balancer will health check and balance traffic between the servers. The app servers will be using a combination of systemd and node cluster to load balance and route traffic around multiple node processes on the server. It will look roughly like this: Photo credit: Digital Ocean How this article is written. Guide to JavaScript Prototypes, Scopes, and Performance. JavaScript: More than meets the eye JavaScript can seem like a very easy language to learn at first.

Guide to JavaScript Prototypes, Scopes, and Performance

Perhaps it’s because of its flexible syntax. Or perhaps it’s because of its similarity to other well known languages like Java. How to deploy your Node.js service. Do you currently deploy your Node.js application with rsync, FTP, or SSH?

How to deploy your Node.js service

Squadron, an easy-to-use configuration tool, is a great way to deploy your Node application to different testing environments. It can grab your code from git, automatically install npm dependencies, and test your code once it's running. Let's get started! The first thing we need to do is get Squadron and its dependencies on each machine you want to use Squadron on.