background preloader

Modules

Facebook Twitter

Passport | Overview. Passport is authentication middleware for Node. It is designed to serve a singular purpose: authenticate requests. When writing modules, encapsulation is a virtue, so Passport delegates all other functionality to the application. This separation of concerns keeps code clean and maintainable, and makes Passport extremely easy to integrate into an application.

In modern web applications, authentication can take a variety of forms. Traditionally, users log in by providing a username and password. With the rise of social networking, single sign-on using an OAuth provider such as Facebook or Twitter has become a popular authentication method. Passport recognizes that each application has unique authentication requirements. Despite the complexities involved in authentication, code does not have to be complicated. Install $ npm install passport app.post('/login', passport.authenticate('local'), function(req, res) { res.redirect('/users/' + req.user.username); }); Redirects Flash Messages Strategies. Node Roundup: Fowl, grunt-ec2, connect-body-rewrite. Fowl Fowl (GitHub: OptimalBits / fowl, License: MIT, npm: fowl) by Manuel Astudillo is a document and query layer for FoundationDB. It provides a similar API to NoSQL databases like MongoDB, but has support for multidocument transactions: Transaction support is an incredibly powerful feature that simplifies server logic and helps avoiding difficult to solve race conditions.

Fowl provides a low level API based on keypaths for describing documents and its properties following CRUD semantics. It includes tests and each API method is documented in the readme file. Grunt-ec2 grunt-ec2 (GitHub: bevacqua / grunt-ec2, License: MIT, npm: grunt-ec2) by Nicolas Bevacqua is a set of Grunt tasks for creating, terminating, and deploying Node applications to AWS EC2 instances.

The deployed Node applications are served from behind an Nginx proxy. Connect-body-rewrite. Ionic: Advanced HTML5 Hybrid Mobile App Framework. Home - DynoSRC. Npm. Connect - High quality middleware for node.js. Connect is a middleware framework for node,shipping with over 18 bundled middleware and a rich selection of3rd-party middleware. var app = connect() .use(connect.logger('dev')) .use(connect.static('public')) .use(function(req, res){ res.end('hello world\n'); }) http.createServer(app).listen(3000); Installation: $ npm install connect Middleware: Links:

Express - api reference. Express() Create an express application. var express = require('express'); var app = express(); app.get('/', function(req, res){ res.send('hello world'); }); app.listen(3000); Application settings The following settings are provided to alter how Express will behave: env Environment mode, defaults to process.env.NODE_ENV (NODE_ENV environment variable) or "development"trust proxy Enables reverse proxy support, disabled by defaultjsonp callback name Changes the default callback name of ?

App.set(name, value) Assigns setting name to value. app.set('title', 'My Site'); app.get('title'); app.get(name) Get setting name value. app.get('title'); app.set('title', 'My Site'); app.get('title'); app.enable(name) Set setting name to true. app.enable('trust proxy'); app.get('trust proxy'); app.disable(name) Set setting name to false. app.disable('trust proxy'); app.get('trust proxy'); app.enabled(name) Check if setting name is enabled. app.enabled('trust proxy'); app.enable('trust proxy'); app.enabled('trust proxy'); The Node Toolbox - Node.js happiness. 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. However, note that there are many tens of thousands of modules in the npm registry, and only just under 2,000 modules here. 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 npmjs.org, node-modules, 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). Table of contents Modules Web frameworks Routers Static file servers Microframeworks.