background preloader

Npm

Npm
Related:  NodeJSInternet related

Node for Rails developers: using Compound.js Getting Started First, let’s talk a little about Coffeescript. Personally, coming from Rails myself, I fell in-love with it. That’s easy to explain, as it mimics Ruby’s syntax quite well, whilst preserving the benefits of Javascript every Node developer is envious about. Rails developers should feel comfortable with CS not only since it’s so Ruby like, but mostly because since it’s Rails’ default javascript interface since version 3.2. That been said, let’s turn to Compound. This post assumes you have Node and NPM installed and ready to go. I chose to initialize my project using Coffescript. We’ll start by installing compound globally, and then initiating our project: [sudo] npm install -g compoundcompound init compound-angular-todo —coffee —tpl jade The result is very much like what you would have expect from Rails to generate. npm install —save-dev node-devnpm install We’re ready to run our server.

appersonlabs/docker.io rogerwang/node-webkit Bower - A package manager for the web nodeschool.io Créer un site simple avec Node.js, Express et Jade - Code4fun - Dev Blog Express est un framework permettant de créer des applications web avec nodejs. Dans cette article nous allons développer un mini site basé sur le framework Express et son moteur de template par defaut : Jade (Voir la demo). Certains sites à fort trafic utilisent déjà Express en production comme : Pour la suite de l’article vous devez disposer du gestionnaire de paquet NPM ainsi que d’un environnement nodejs. Installation/Configuration Commencez par installer express via le gestionnaire de paquet npm : Puis créez un projet express en utilisant la commande : Et pour finir installez les dépendances : La commande npm install se sert du package.json pour connaitre les modules à installer. Vous pouvez maintenant lancer le serveur (node app.js), le site est accessible en local sur le port 3000: Comment ça marche ? Express a généré un projet contenant : Regardons de plus près app.js : Par défault express déporte les routes dans routes/index.js. permet de lier la requête GET / à la fonction :

Creating Desktop Applications With node-webkit Web applications are useful, but there are some cases where it’s not desirable or necessary to host an application on a remote server. As HTML5 provides low-level functionality to modern browsers, such as the ability to read and write files, it’s now possible to create offline, single-page, JavaScript applications using a web browser as a platform. While browser-based unhosted applications present some interesting possibilities, such as the ability to deploy your application on multiple operating systems, there are some significant limitations. When using browsers one’s control of the user interface is limited. Another potential issue with web applications in general is variance between browsers and browser versions. Last, but not least, most browsers are configured to be secure against malicious content. Enter Node-WebKit The node-webkit project, which was created at Intel and open sourced in 2011, is an attempt to take the pain out of offline single-page application development. <!

Downloads - MongoDB This table lists MongoDB distributions by platform and version. We recommend using these binary distributions, but there are also packages available for various package managers. Notes 32-bit builds are limited to around 2GB of data. Cloud Hosting You can also get access to a MongoDB instance in the cloud. Drivers Information on how to separately download or install the drivers and tools can be found on the Drivers page. Source Code Source code is available for MongoDB and all drivers. Packages MongoDB is included in several different package managers. For MacPorts, see the mongodb package. Documentation PDF In addition to the MongoDB Manual, you can download a PDF of the MongoDB Manual.

Explore Flask — Explore Flask 1.0 documentation Explore Flask is a book about best practices and patterns for developing web applications with Flask. The book was funded by 426 backers on Kickstarter in July 2013. I finally released the book, after spending almost a year working on it. In June of 2014, soon after finishing the book, I reformatted it for the web and released it here for free. About the author¶ My name is Robert Picard. If you want to get in touch, feel free to send me an email at robert@robert.io. Thank you¶ First of all, I’d like to say thank you to my volunteer editor, Will Kahn-Greene. Another big thanks to everyone who took the time to talk with me about how they are using Flask. The cover and all the illustrations in this book were done by Dominic Flask. Explore Flask wouldn’t be happening if it weren’t for the hundreds of people who backed the project on Kickstarter. As promised in the Kickstarter project, here are the names of all of the generous men and women who pledged $50 or more:

nulltask/node-processing Comment télécharger un fichier avec Node.js ? - Social Mobile dev Vous pouvez télécharger un fichier avec HTTP.get. L'intérêt de cette méthode de téléchargement, par rapport aux méthodes avec CURL et WGET, est qu'on ne dépend pas d'un programme externe. Dans cet exemple, nous utilisons les modules fs pour l'accès au système de fichier et http : var fs = require('fs'); var http = require('http'); On spécifie l'URL du fichier à télécharger : var url_filename = ''; On prépare les options que l'on va transmettre à la fonction http.get : host : c'est le nom de domaine ou l'adresse IP du serveur port : c'est le port (par exemple 80 pour HTTP) path : c'est le chemin d'accès, comprenant requête query (exemple : index.php) On extrait le nom du fichier de l'URL : var file_name = url.parse(url_filename).pathname.split('/').pop(); On crée le fichier en local : var file = fs.createWriteStream('./' + file_name); http.get(options, function(res) { res.on('data', function(data) { On écrit toutes les données reçues : file.write(data); }).on('end', function() {

mikeal/filed expressjs/generator HTTP Node.js v0.10.33 Manual Stability: 3 - Stable To use the HTTP server and client one must require('http'). The HTTP interfaces in Node are designed to support many features of the protocol which have been traditionally difficult to use. In particular, large, possibly chunk-encoded, messages. HTTP message headers are represented by an object like this: Keys are lowercased. In order to support the full spectrum of possible HTTP applications, Node's HTTP API is very low-level. http.STATUS_CODES# A collection of all the standard HTTP response status codes, and the short description of each. http.createServer([requestListener])# Returns a new web server object. The requestListener is a function which is automatically added to the 'request' event. http.createClient([port], [host])# This function is deprecated; please use http.request() instead. Class: http.Server# This is an EventEmitter with the following events: Event: 'request'# function (request, response) { } Emitted each time there is a request. Event: 'connection'# or

Related: