background preloader

Modules · joyent/node Wiki

Modules · joyent/node Wiki
This page is deprecated. Feel free to add to it, but be advised that it is, at best, a faded relic of Node modules that were written before npm was a dominant force in the Node.js ecosystem. It is not all that useful any more. If you are a newcomer, it can be handy to at least get a starting point. So, this list is long enough to be intimidating, but still only captures a tiny sliver of the Node.js modules you can use with your program. Search for modules with, node-modules, node-toolbox and nipster. The archaic contents of this once-useful page now follow. Adding to this page When you add a framework to this page, have a look at how others have done so, it should be a single item, with a link to the project's source code, and a short description (one line after formatting has been applied). If you see a module without a description, feel free to edit the page and add it in, any contributions are appreciated. Table of contents Modules Web frameworks Routers Static file servers Related:  Node JS

Полезные инструменты, туториалы и ресурсы Созданый Райаном Далем в 2009 году, Node.js — относительно новая технология, завоевавшая в последнее время большую популярность среди веб-разработчиков. Однако, до сих пор не каждый знает, что на самом деле Node.js это серверная JavaScript среда, использующая асинхронную событийную модель. Что это означает? Все просто: это среда, которая предназначена для написания масштабируемых, высокопроизводительных приложений. Почти как Ruby’s Event Machine или Python’s Twisted, но гораздо глубже — JavaScript реализовывает цикл событий, на уровне самого языка, а не как отдельная библиотека. И это еще не все: то, что действительно круто в Node.js — это тысячи модулей, доступных для любых целей, а также активниешее сообщество этого молодого проекта. Полезные инструменты Node.js Node Express Boilerplate Node Express Boilerplate позволяет начать проект с чистого листа, но при этом сразу же обеспечивает решение всех тех рутинных задач, которые зачастую могут сорвать проект еще до того, как он начат.

Perfection kills » Understanding delete A couple of weeks ago, I had a chance to glance through Stoyan Stefanov’s Object-Oriented Javascript. The book had an exceptionally high rating on Amazon (12 reviews with 5 stars), so I was curious to see if it was something worth recommending. I started reading through chapter on functions, and really enjoyed the way things were explained there; the flow of examples was structured in such nice, progressive way, it seemed even beginners would grasp it easily. However, almost immediately I stumbled upon an interesting misconception present throughout the entire chapter — deleting functions. The book claims that “function is treated as a normal variable—it can be copied to a different variable and even deleted.”. >>> var sum = function(a, b) {return a + b;} >>> var add = sum; >>> delete sum true >>> typeof sum; "undefined" Ignoring a couple of missing semicolons, can you see what’s wrong with this snippet? So what’s going on in this example? Theory§ but not variables, declared like this:

The Node Beginner Book How To Node - NodeJS livelycode/aws-lib - GitHub impress Impressive totalitarian style Multipurpose Application Server for node.js. All decisions are made. Solutions are scaled. Tools are provided and optimized for high load. Ready for applied development and production. The main difference from others that Impress core is monolithic and its approach is to make all in one solution with high code coupling for obligatory things and leave not obligatory to be integrated by applied developers optionally. Installation $ npm install impress Features Configuration Install module using "npm install impress" in new directory. Handler examples and file system url mapping Example Following "server.js" is stating file. require('impress'); impress.server.on("start", function() { }); impress.server.start(); File "access.js" is something line ".htaccess", you can easily define access restrictions for each folder, placing "access.js" in it. File "request.js": place such file in folder to be executed on each request (GET, POST, PUT, etc.). <! Contributors License

Inheritance and Initialization in Node.js Javascript inheritance is an interesting topic, rife with pitfalls for the unwary, and this is no less true in node.js than in any other modern application of Javascript. For example, this is a common gotcha that I noted while translating thywill-python, an experiment-with-slash-exploration-of Comet frameworks, into node.js. Let's say I have a hierarchy of classes, A, B, and C, which extend out from EventEmitter as follows: The function util.inherits(subclass, superclass) is a shortcut for one of the methods of Javascript inheritance, provided in core node.js, and it looks like this under the hood: Note that you'd have to be using Chrome or Firefox 4 if you want that to work on a web page - Object.create is a comparatively recent addition to Javascript. In this example, my particular need is for all instances of subclasses of B (i.e. instances of C in this case) to notify a central repository of their existence and then emit an event marking their creation.

Express - node web framework Getting started With node installed (download), get your first application started by creating a directory somewhere on your machine: $ mkdir hello-world In this same directory you'll be defining the application "package", which are no different than any other node package. Now that you have a package.json file in this directory you can use npm(1) to install the dependencies, in this case just Express: $ npm install Once npm finishes you'll have a localized Express 3.x dependency in the . $ npm ls hello-world@0.0.1 /private/tmp └─┬ express@3.0.0beta7 ├── commander@0.6.1 ├─┬ connect@2.3.9 │ ├── bytes@0.1.0 │ ├── cookie@0.0.4 │ ├── crc@0.2.0 │ ├── formidable@1.0.11 │ └── qs@0.4.2 ├── cookie@0.0.3 ├── debug@0.7.0 ├── fresh@0.1.0 ├── methods@0.0.1 ├── mkdirp@0.3.3 ├── range-parser@0.0.4 ├─┬ response-send@0.0.1 │ └── crc@0.2.0 └─┬ send@0.0.3 └── mime@1.2.6 Now to create the application itself! var express = require('express'); var app = express(); Using express(1) to generate an app Then fire it up!

creationix/ - GitHub

Related:  node.js