background preloader

Tutorial - Getting Started With Node.js, Express, MongoDB

Tutorial - Getting Started With Node.js, Express, MongoDB

Node.js Tutorial With Socket.io – Daniel Nill I was shocked to recently discover that there are no great quick tutorial on the basics of using socket.io with node js. While there isn’t a whole lot to it, someone not familiar with node.js and the protocol for WebSockets is left to scrounge for random snippets of code. Trying to parse the protocol of Websockets while learning the socket.io library and the basics of Node.js all at the same time is no easy feat. So I thought I would take a brief stab at filling this void. What We Will Cover: In this tutorial we will cover setting up a Node.js server and router (You can find this many places but it is a necessary first step) connecting socket.io to this server sending data to the client through the socket connection sending data to the server through the socket connection Your Basic Server: There are several modules you can use to initiate a server in Node.js, but they are all pretty much the same. var http = require('http'); var server = http.createServer(); server.listen(8001);

Node.js Language Center You use Node.js to write event-driven, scalable network programs in server-side JavaScript. Node.js runs on Google’s V8. This section describes the available tools and suggested practices for using Node.js with MongoDB. For a more detailed discussion, see the Node.js Driver Manual. The following are the README and source code: Node.js Driver The MongoDB Node.js driver is the officially supported node.js driver for MongoDB. Install or Upgrade The easiest way to install is to use npm: Object Mappers Because MongoDB is so easy to use, the basic Node.js driver can be the best solution for many applications. Other Notable Projects Mongoskin: Layer for node-mongodb-native.Mongolia: Lightweight MongoDB ORM/driver wrapper.Mongojs: Somewhat mimics the MongoDB shell api. Each of these projects build on top of the native Node.js driver, and so some knowledge of that is useful, especially if you work with a custom MongoDB configuration. 3rd Party Drivers A few 3rd party drivers exist.

Streams in JavaScript: a versatile Tool - codecentric Blog Streams in Node.js are an important and versatile Tool. Unix Pipes were an example for Streams. At the beginning they were just representations of byte sequences or strings, built to improve the efficiency of the internals of Node.js, especially the parsers. What is a Stream? A Stream is an abstraction of a sequence of data, which is distributed in time. Streams have a few properties we have to consider when working with them. A Stream in Node.js can be readable, writable or both, which we call Duplex stream. Streams are versatile Well, how can we use streams? In this code, a file is read with a Readable stream and processed chunk-by-chunk. Now we can see an important strength of streams: they are highly combinable. Because streams are really sequences, they can be processed very similarly to arrays and lists. So you can export a stream, or a factory function which returns a stream, to make your module seamlessly cooperate with others. Streams and Functional Programming Int -> Int -> Int

Node.js for Java developers JavaScript has over the past few years emerged as an under-sung hero of web application development. This recognition has been often met by surprise from software developers accustomed to dismissing JavaScript as a "toy language." While there are more popular languages (in the sense that developers clamor to announce their allegiance to them), JavaScript's unique status as the standard, browser-neutral scripting language has lent it staying power. JavaScript also has a place in server-side scripting, and that niche is growing. Designed to assist developers in building scalable network programs, Node is a server-side programming environment that has virtually reinvented JavaScript for a whole new generation of developers. In this article, I introduce you to the server-side scripting revolution that is Node. Node's event-driven concurrency Node is a scalable, event-driven I/O environment built on top of Google's V8 JavaScript engine. Concurrency just works in Node programs. Back to top

Node.js and MongoDB - Getting started with MongoJS HEADS UP! This article was written for an older version of node. More up-to-date information may be available elsewhere. It won't be an exaggeration if one claims that in the past few months Node.js and MongoDB have literally taken the software and web industries by storm. Not just bleeding-edge startups but even medium and large enterprises are leveraging these two technologies to deliver a better experience to their users by build more capable, performant and scalable apps. So what is Node.js? Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. ..and what is MongoDB? MongoDB is a scalable, high-performance, open source NoSQL database. This post will cover the basics and get you started with your Node.js + MongoDB app. Let's verify your Node.js installation and start the MongoDB server: $ node -v$ mongod Introducing MongoJS Installing MongoJS $ npm install mongojs Okay, how do I save a new user in my collection? $ node app.js

krakenjs/lusca Mac OS X packages PostgreSQL is the default database on Mac OS X Server as of version 10.7. The standard version of Mac OS X includes only the PostgreSQL commandline client utilities. Mac OS X Server 10.7 ships with PostgreSQL 9.0. There are several other installers available for PostgreSQL on Mac OS X, which is the recommended way to install. Graphical installer An installer is available for Mac OS X that includes PostgreSQL, pgAdmin and the StackBuilder utility for installation of additional packages. Download the installer from EnterpriseDB for all supported versions. Postgres.app Postgres.app is a simple, native Mac OS X app that runs in the menubar without the need of an installer. Fink PostgreSQL packages are available for Mac OS X from the Fink Project. A list of PostgreSQL packages can be found using the package search tool on the Fink website. MacPorts PostgreSQL packages are also available for Mac OS X from the MacPorts Project. Homebrew PostgreSQL can also be installed on Mac OS X using Homebrew.

Koa - next generation web framework for node.js Install MySQL on Mountain Lion. | Mac Mini Vault UPDATE 02/26/2013: You can skip all these steps and use the install script on our github [LINK] page to automate the installation of MySQL. Then just install a management program (Sequel Pro) and you are all set! UPDATE 10/9/2013: Be sure to check out our post on MySQL installation for OS X 10.9 Mavericks! ———— Last year when OS X 10.7 Lion was released we found ourselves with a version of OS X Server without MySQL and basic web hosting capabilities. Luckily by 10.7.3 most of the necessary web hosting functionality was added to Server.app. Today OS X 10.8 Mountain Lion was released and we are going to do a few write ups on how to install MySQL and do some basic CMS/Blog web hosting. dev.mysql.com/downloads/mysql Look for the DMG of the latest 64-bit version (10.6 will work)Note: If you visit this link from a Mac it will automatically select the OS X Platform. We need to do a few things from a command prompt. user@computer:$ vi .bash_profile export PATH=$PATH:/usr/local/mysql/bin

nodeschool.io

Related: