Skip to content
Browse files

[docs] Properly generated book.html and book.pdf

  • Loading branch information...
1 parent aeb5a3b commit ec136e6a7c830a3824deeacad90a691d955ccd0d @AvianFlu AvianFlu committed Jun 6, 2011
Showing with 592 additions and 1 deletion.
  1. +592 −1 book.html
  2. BIN book.pdf
View
593 book.html
@@ -25,5 +25,596 @@
</style>
</head>
- <body> </body>
+ <body><div class='mp'>
+<h1>The Nodejitsu Handbook</h1>
+<p><em>A gentle introduction to the art of Nodejitsu</em></p>
+
+<p>Welcome to the Nodejitsu handbook. This document will help familiarize you with deploying your Node.js applications to the cloud while also providing detailed information about Nodejitsu's platform specific features. This is a living document which you can submit patches to @ <a href="http://github.com/nodejitsu/handbook" data-bare-link="true">http://github.com/nodejitsu/handbook</a>.</p>
+
+<h2 id="Who-is-Nodejitsu-">Who is Nodejitsu?</h2>
+
+<p>We are a collective of seasoned developers who have been devoted to the Node.js project since 2009. We are community leaders have who created and contributed to hundreds of open-source Node.js projects. If you have used Node.js, you've probably used code we've help create. Check out our <a href="http://github.com/nodejitsu">Github</a>.</p>
+
+<h2 id="What-Is-Nodejitsu-">What Is Nodejitsu?</h2>
+
+<p><a href="http://nodejitsu.com/">Nodejitsu</a> is the Platform as A Service and Marketplace for Node.js applications. Nodejitsu allows you to seamlessly deploy your Node.js applications into the cloud with a myriad of additional features. Our platform provides a robust suite of functionality to assist in the development, management, and deployment of Node.js applications. Our deployment tools are the most user-friendly in the industry and our customer support is unparalleled.</p>
+
+<h2 id="How-Can-I-Get-Started-">How Can I Get Started?</h2>
+
+<p>So you wish to learn the ways of Nodejitsu? Excellent! Reading this sentence is the first step! Below, you will find the Table Of Contents which provides an overview of the systems which comprise Nodejitsu. We suggest starting at <a href="#Deploying_Applications" data-bare-link="true">Deploying Applications</a>. You can also always visit our website at <a href="http://nodejitsu.com" data-bare-link="true">http://nodejitsu.com</a>. Good Luck!</p>
+
+</div>
+<div class='mp'>
+<h1>Table of Contents</h1>
+<ul>
+<li><a href="#Deploying_Applications" data-bare-link="true">Deploying Applications</a></li>
+<li><a href="#Using_The_Jitsu_Client" data-bare-link="true">Using the Jitsu Client</a>
+
+<ul>
+<li><a href="#Installation" data-bare-link="true">Installation</a></li>
+<li><a href="#Usage" data-bare-link="true">Usage</a></li>
+</ul>
+</li>
+<li><a href="#Using_The_API" data-bare-link="true">Using the API</a>
+
+<ul>
+<li><a href="#Applications" data-bare-link="true">Applications</a></li>
+<li><a href="#Snapshots" data-bare-link="true">Snapshots</a></li>
+<li><a href="#Users" data-bare-link="true">Users</a></li>
+<li><a href="#Databases" data-bare-link="true">Databases</a></li>
+<li><a href="#Logging" data-bare-link="true">Logging</a></li>
+<li><a href="#Marketplace" data-bare-link="true">Marketplace</a></li>
+</ul>
+</li>
+<li><a href="#Using_Databases" data-bare-link="true">Using Databases</a>
+
+<ul>
+<li>Creating new Databases</li>
+<li>Connecting existing Databases</li>
+</ul>
+</li>
+<li><a href="#Open_source_Projects" data-bare-link="true">Nodejitsu's Open-source Projects</a>
+
+<ul>
+<li>Why open-source</li>
+<li>Where to find</li>
+<li>How to contribute</li>
+</ul>
+</li>
+<li><a href="#Additional_Information" data-bare-link="true">Additional Information</a>
+
+<ul>
+<li><a href="#Installing_Node" data-bare-link="true">Installing Node.js</a></li>
+<li><a href="#Installing_npm" data-bare-link="true">Installing NPM</a></li>
+<li><a href="#New_to_Node" data-bare-link="true">New to Node?</a></li>
+<li><a href="#Package_Json" data-bare-link="true">Creating a package.json</a></li>
+</ul>
+</li>
+</ul>
+
+
+</div>
+<div class='mp'>
+<h1><p><a name="Deploying_Applications"></a></p>
+
+Deploying Applications</h1>
+<p>We've got three basic ways to deploy your application.</p>
+
+<ul>
+<li><a href="#Using_The_Jitsu_Client" data-bare-link="true">Jitsu</a>, The Nodejitsu Command Line Tool</li>
+<li><a href="http://develop.nodejitsu.com/">Samurai</a>, An easy to use Web Admin</li>
+<li>The <a href="#Using_The_API" data-bare-link="true">API</a>, A high-level JSON API</li>
+</ul>
+
+
+<p>If it is your first time deploying an application and you are eager to get started, we recommend that you try out <a href="#Using_The_Jitsu_Client" data-bare-link="true">Jitsu</a>, our CLI tool. Jitsu has a one line installer, it's self-documenting, and you'll be able to deploy your app in seconds.</p>
+
+<p>Let's start with a very basic node.js http server:</p>
+
+<pre><code> // requires node's http module
+ var http = require('http');
+
+ // creates a new httpServer instance
+ http.createServer(function (req, res) {
+ // this is the callback, or request handler for the httpServer
+
+ // respond to the browser, write some headers so the
+ // browser knows what type of content we are sending
+ res.writeHead(200, {'Content-Type': 'text/html'});
+
+ // write some content to the browser that your user will see
+ res.write('&lt;h1&gt;hello, i know nodejitsu.&lt;/h1&gt;')
+
+ // close the response
+ res.end();
+ }).listen(80); // the server will listen on port 80
+</code></pre>
+
+<p>That's all the code you'll need for starters - name the file <code>server.js</code> (or anything else you'd like), and put it in a folder named <code>myapp</code>.
+We'll come back to this code in a minute - now, it's time to learn some Jitsu.</p>
+
+</div>
+<div class='mp'>
+<h1><p><a name="Using_The_Jitsu_Client"></a></p>
+
+Using The Jitsu Client</h1>
+<p><a href="http://github.com/nodejitsu/jitsu">Jitsu</a> is a <a href="http://en.wikipedia.org/wiki/Command-line_interface">Command Line Interface (CLI)</a> for interacting with the Nodejitsu platform. It's open-source and easy to use. We've designed Jitsu to be suitable for command line beginners, but still be powerful and extensible enough for production usage. If you aren't a fan of the command line or don't have terminal access you can still do everything Jitsu can do through our web admin, <a href="http://nodejitsu.com">Samurai</a>.</p>
+
+<p>Jitsu requires the Node Package Manager ( npm ). If you need help installing npm go to: <a href="#Installing_npm" data-bare-link="true">Installing npm</a></p>
+
+<p><a name="Installation"></a></p>
+
+<h2 id="Installation">Installation</h2>
+
+<pre><code> [sudo] npm install jitsu
+</code></pre>
+
+<p><img src="https://github.com/nodejitsu/jitsu/raw/master/assets/jitsu.png" /></p>
+
+<p><a name="Usage"></a></p>
+
+<h2 id="Usage">Usage</h2>
+
+<p><code>jitsu</code> is mostly self documenting. After installation, run the <code>jitsu</code> command from your command line.</p>
+
+<p>If it's your first time using <code>jitsu</code>, you will be prompted to login with an existing account or create a new account.</p>
+
+<p><img src="https://github.com/nodejitsu/jitsu/raw/master/assets/login.png" /></p>
+
+<p><strong>After you've logged in, you can start deploying apps immediately!</strong></p>
+
+<h2 id="One-line-deployment">One-line deployment</h2>
+
+<pre><code>cd /path/to/myapp
+jitsu deploy
+</code></pre>
+
+<p>This will create a new application, package.json ( if you need one ), and deploy the current path to <a href="http://nodejitsu.com">Nodejitsu</a>. If it's your first deployment, you'll be prompted for some information such as <em>subdomain</em> and <em>start script</em> but it's really easy and we promise it will only take a few seconds.</p>
+
+<p>Now just open up your favorite browser, and go to yoursubdomain.nodejitsu.com. If everything has been set up correctly, then you, too, are on the path of nodejitsu!</p>
+
+<p>If you have any issues deploying your node.js application please feel free to open up an issue on the <a href="https://github.com/nodejitsu/jitsu/issues">Github Issues</a> section of the jitsu homepage. We'll have someone get back to you in a flash!</p>
+
+<h2 id="Command-Line-Usage">Command Line Usage</h2>
+
+<p><code>jitsu</code> is mostly self-documenting. Try any of these commands to get started.</p>
+
+<p> <strong>Usage:</strong></p>
+
+<pre><code>jitsu &lt;resource> &lt;action> &lt;param1> &lt;param2> ...
+</code></pre>
+
+<p> <strong>Common Commands:</strong></p>
+
+<p> <em>Deploys current path to <a href="http://nodejitsu.com">Nodejitsu</a></em></p>
+
+<pre><code>jitsu deploy
+</code></pre>
+
+<p> <em>Creates a new application on <a href="http://nodejitsu.com">Nodejitsu</a></em></p>
+
+<pre><code>jitsu create
+</code></pre>
+
+<p> <em>Lists all applications for the current user</em></p>
+
+<pre><code>jitsu list
+</code></pre>
+
+<p> <em>Additional Commands</em></p>
+
+<pre><code>jitsu apps
+jitsu snapshots
+jitsu users
+jitsu conf
+jitsu logout
+</code></pre>
+
+<h3 id="Help">Help</h3>
+
+<p>All commands will yield friendly messages to you if you specify incorrect parameters, but we have also included help commands for all available command and configuration options. If you find anything difficult to use, please open up a Github issue or pull request!</p>
+
+<pre><code>jitsu help
+jitsu help apps
+jitsu help snapshots
+jitsu help users
+jitsu help config
+</code></pre>
+
+<h2 id="-jitsuconf-file">.jitsuconf file</h2>
+
+<p>All configuration data for your local <code>jitsu</code> install is located in the <em>.jitsuconf</em> file located in your home directory. Directly modifying this file is not advised. You should be able to make all configuration changes via:</p>
+
+<pre><code>jitsu config
+</code></pre>
+
+</div>
+<div class='mp'>
+<h1><p><a name="Using_The_API"></a></p>
+
+Using The API</h1>
+<p>Nodejitsu provides a web API for developers who want to interact with the Nodejitsu platform programatically. This API is built to be <a href="http://en.wikipedia.org/wiki/Representational_State_Transfer">RESTful</a> and communicates via <a href="http://en.wikipedia.org/wiki/JSON">JSON</a>. The API is the most low-level way of interacting with the Nodejitsu platform. For most deployment scenarios you should use our command line tool, <a href="#Using_The_Jitsu_Client" data-bare-link="true">jitsu</a>, or login directly at <a href="http://nodejitsu.com" data-bare-link="true">http://nodejitsu.com</a></p>
+
+<ul>
+<li><a href="#Applications" data-bare-link="true">Applications</a></li>
+<li><a href="#Snapshots" data-bare-link="true">Snapshots</a></li>
+<li><a href="#User" data-bare-link="true">Users</a></li>
+<li><a href="#API_Databases" data-bare-link="true">Databases</a></li>
+<li><a href="#Logging" data-bare-link="true">Logging</a></li>
+<li><a href="#Marketplace" data-bare-link="true">Marketplace</a></li>
+</ul>
+
+
+<p>The documentation here should be an accurate representation of our current API, but you can always look directly at our <a href="https://github.com/nodejitsu/jitsu/tree/master/lib/jitsu/api">API wrappers</a> in <code>jitsu</code> to see a working example of an application built against Nodejitsu's REST API.</p>
+
+<h2 id="Authentication">Authentication</h2>
+
+<p>Most of the calls to the API will require that you authenticate using your Nodejitsu account. If you do not have an account it is possible to create one using the User API, the Jitsu CLI, or just by visiting <a href="http://nodejitsu.com" data-bare-link="true">http://nodejitsu.com</a>. Currently, we support <a href="http://en.wikipedia.org/wiki/Basic_access_authentication">Basic Authentication</a>. If you haven't used Basic Auth before don't fret, it's easy!</p>
+
+<p><strong>Here is an example using the command line utility, <a href="http://curl.haxx.se/">Curl</a>.</strong></p>
+
+<pre><code> // get all applications for User "Marak"
+ curl --user Marak:password http://nodejitsu.com/apps/marak
+</code></pre>
+
+<p>If you are trying to use our API directly and are having issues with Basic Auth, please feel free to email <a href="mailto:support@nodejitsu.com" data-bare-link="true">support@nodejitsu.com</a></p>
+
+<p><a name="Applications"></a></p>
+
+<h2 id="Applications">Applications</h2>
+
+<p>Applications are the core of the Nodejitsu API. Each application represents a set of Node.js code plus a package.json which contains meta-data about the application such as it's dependencies, database connections, configuration settings, authors, etc. For more information about the package.json format see: <a href="#package_json" data-bare-link="true">package.json</a></p>
+
+<h4 id="Get-all-Applications-for-a-User">Get all Applications for a User</h4>
+
+<pre><code> GET /apps/:user-id
+</code></pre>
+
+<h4 id="Create-a-new-Application">Create a new Application</h4>
+
+<pre><code> POST /apps/:user-id
+ { package.json }
+</code></pre>
+
+<h4 id="Start-an-Application">Start an Application</h4>
+
+<pre><code> POST /apps/:user-id/:app-id/start
+</code></pre>
+
+<h4 id="Stop-an-Application">Stop an Application</h4>
+
+<pre><code> POST /apps/:user-id/:app-id/stop
+</code></pre>
+
+<h4 id="Restart-an-Application">Restart an Application</h4>
+
+<pre><code> POST /apps/:user-id/:app-id/restart
+</code></pre>
+
+<h4 id="Update-an-Application">Update an Application</h4>
+
+<pre><code> PUT /apps/:user-id
+ { package.json }
+</code></pre>
+
+<h4 id="Delete-an-Application">Delete an Application</h4>
+
+<pre><code> DELETE /apps/:user-id/:app-id/remove
+</code></pre>
+
+<p><a name="Snapshots"></a></p>
+
+<h2 id="Snapshots">Snapshots</h2>
+
+<p>Snapshots are an easy way to capture the current state of your application. Once a Snapshot of your application is created you can roll back and activate that Snapshot at any time.</p>
+
+<h4 id="Make-an-existing-snapshot-the-active-app">Make an existing snapshot the active app</h4>
+
+<pre><code>PUT /apps/:user-id/:app-id/snapshots/:id/active
+</code></pre>
+
+<h4 id="Activate-Deploy-a-snapshot">Activate / Deploy a snapshot</h4>
+
+<pre><code>POST /apps/:user-id/:snapshots/:id
+</code></pre>
+
+<h4 id="Show-a-catalog-of-all-Snapshot-for-an-Application">Show a catalog of all Snapshot for an Application</h4>
+
+<pre><code>GET /apps/:user-id/:app-id/snapshots
+</code></pre>
+
+<h4 id="Show-the-contents-of-a-Snapshot">Show the contents of a Snapshot</h4>
+
+<pre><code>GET /apps/:user-id/:app-id/snapshots/:id
+</code></pre>
+
+<p><a name="Users"></a></p>
+
+<h2 id="Users">Users</h2>
+
+<h4 id="Create-a-new-User-Sign-up-for-a-free-Nodejitsu-account">Create a new User / Sign-up for a free Nodejitsu account</h4>
+
+<p>Email address is the only required field.</p>
+
+<pre><code> POST /users/:user-id
+ {
+ email: "youremail@theinternet.com"
+ }
+</code></pre>
+
+<h4 id="Confirm-a-User-account">Confirm a User account</h4>
+
+<p>All User accounts must be confirmed. When a new User is created, a confirmation email will be sent to the email address associated with that user. In this email there will be an invite code. This code must be sent to the API to confirm the account.</p>
+
+<pre><code>POST /users/:user-id
+{
+ inviteCode: "SecretCode"
+}
+</code></pre>
+
+<h4 id="Update-User">Update User</h4>
+
+<pre><code>PUT /users/:user-id
+{
+ password: "new_password"
+}
+</code></pre>
+
+<p><a name="Databases"></a></p>
+
+<h2 id="Databases">Databases</h2>
+
+<p>Databases are an integral part of most applications. The Nodejitsu API allows you to dynamically create new hosted database instances for your applications. Cloud database hosting is provided by: CouchOne, Redis2Go and MongoHQ.</p>
+
+<h4 id="Create-a-new-Database">Create a new Database</h4>
+
+<pre><code> POST /databases/:user-id/:database-id
+
+ {
+ type: "Couch || Redis || Mongo"
+ }
+</code></pre>
+
+<h4 id="Get-information-about-a-Database">Get information about a Database</h4>
+
+<pre><code>GET /databases/:user-id/:database-id
+</code></pre>
+
+<h4 id="Delete-a-Database">Delete a Database</h4>
+
+<pre><code>DELETE /databases/:user-id/:database-id
+</code></pre>
+
+<p><a name="Logging"></a></p>
+
+<h2 id="Logging">Logging</h2>
+
+<p>Logging is a very important feature in any professional grade Node.js application. Nodejitsu provides integrated logging solutions for your applications. Your logs are always saved and ready to be retrieved. TODO: add better description on logging</p>
+
+<h4 id="Get-all-logs-for-a-user">Get all logs for a user</h4>
+
+<pre><code> GET /logs/:user-id/
+</code></pre>
+
+<h4 id="Get-logs-for-a-specific-application">Get logs for a specific application</h4>
+
+<pre><code> GET /logs/:user-id/:app-id
+</code></pre>
+
+<p><a name="Marketplace"></a></p>
+
+<h2 id="Marketplace">Marketplace</h2>
+
+<p>The Marketplace is an online store where you can browse ready to deploy Node.js Applications. The Marketplace is a great place to start if you are new to Node.js development or want to share your existing Node.js Application with the world.</p>
+
+<h4 id="Get-all-Marketplace-Applications">Get all Marketplace Applications</h4>
+
+<pre><code>GET /marketplace
+</code></pre>
+
+<h4 id="Get-a-specific-Marketplace-Application">Get a specific Marketplace Application</h4>
+
+<pre><code>GET /databases/:user-id/:id
+</code></pre>
+
+</div>
+<div class='mp'>
+<h1><p><a name="Using_Databases"></a></p>
+
+Using Databases</h1>
+<p>Applications on Nodejitsu are ready to be connected to any database. If you have already have a database running, Nodejitsu can connect to your pre-existing database. If you require a new database, Nodejitsu can provide you FREE instances of several different types of databases. These free instances are great for development purposes or hobby sites. If you require a high traffic or production database we provide an easy upgrade path to industrial strength database hosting.</p>
+
+<h2 id="Creating-new-Databases">Creating new Databases</h2>
+
+<p>If you require database hosting you can create a new database instance of any of our supported databases using <a href="#Deploying_Applications" data-bare-link="true">Samurai</a>, <a href="#Using_The_Jitsu_Client" data-bare-link="true">Jitsu</a>, or our <a href="#Using_The_API" data-bare-link="true">API</a>.</p>
+
+<h2 id="Existing-Databases">Existing Databases</h2>
+
+<p>If you already have an externally hosted Database, Nodejitsu is capable of connecting to it. We've got Database hosting if you need it, but we fully support externally hosted Databases. Feel free to drop us an email if you have any questions.</p>
+
+<h2 id="Connecting-Applications-to-Databases">Connecting Applications to Databases</h2>
+
+<p>If you want to connect a Database to your Node.js application, Nodejitsu provides you with sample code for each Database type as well as the ability to specify database connection strings in your application's package.json</p>
+
+<pre><code> TODO: Add better package.json configuration description
+</code></pre>
+
+</div>
+<div class='mp'>
+<h1><p><a name="#Open_source_Projects"></a></p>
+
+Open-source Projects</h1>
+<h2 id="Why-open-source">Why open-source</h2>
+
+<p>A lot of Nodejitsu's technology stack is released as open-source software. We choose to do this for many reasons. Aside from being able to give back to the very awesome Node.js community, releasing pieces of our stack as open-source allows other developers to review and improve our software. We've already received invaluable contributions to our platform from developers who would have never seen our code if we had not open-sourced it.</p>
+
+<h2 id="Where-to-find">Where to find</h2>
+
+<p>Nodejitsu hosts its open-source projects on <a href="http://github.com/nodejitsu">Github.com</a>. Github is website for sharing and collobrating on source code. You can get source code without creating an account and if you want to create an account it's free. You'll need a <a href="http://gitscm.org/">Git</a> client if you wish to check out any of our code repositories.</p>
+
+<p>You can visit our open-source project directory at: <a href="http://github.com/nodejitsu" data-bare-link="true">http://github.com/nodejitsu</a></p>
+
+<h2 id="How-to-contribute">How to contribute</h2>
+
+<p>Anyone can contribute to any Nodejitsu open-source projects at any time. <a href="http://github.com/nodejitsu">Github</a> has the facilities for managing patches, issues, code comments, version control, etc. If you have any questions about a project you sign up and create a Github issue. We'll make sure one our ninjas gets back to you soon.</p>
+
+</div>
+<div class='mp'>
+<h1><p><a name="Additional_Information"></a></p>
+
+Additional Information</h1>
+<p>If you are new to Node.js and Node.js application deployment, you might find the following section helpful.</p>
+
+<p><a name="Installing_Node"></a></p>
+
+<h2 id="Installing-Node-js">Installing Node.js</h2>
+
+<h3 id="Building-and-Installing-Node-js">Building and Installing Node.js</h3>
+
+<h3 id="Step-1-Pick-Your-Platform">Step 1 - Pick Your Platform</h3>
+
+<p>Node should install out of the box on Linux, Macintosh, and Solaris.</p>
+
+<p>With some effort you should be able to get it running on other Unix
+platforms and Windows (either via Cygwin or MinGW).</p>
+
+<h3 id="Step-2-Prerequisites">Step 2 - Prerequisites</h3>
+
+<p>Node has several dependencies, but fortunately most of them are
+distributed along with it. If you are building from source you should
+only need 2 things.</p>
+
+<ul>
+<li><p><strong>python</strong> - version 2.4 or higher. The build tools distributed with
+Node run on python.</p></li>
+<li><p><strong>libssl-dev</strong> - If you plan to use SSL/TLS encryption in your
+networking, you'll need this. Libssl is the library used in the
+<a href="http://www.openssl.org/">openssl</a> tool. On Linux and Unix systems
+it can usually be installed with your favorite package manager. The
+lib comes pre- installed on OS X.</p></li>
+</ul>
+
+
+<h3 id="Step-3a-Installing-on-Unix-including-BSD-and-Mac-">Step 3a - Installing on Unix (including BSD and Mac)</h3>
+
+<p><strong>Building from source</strong></p>
+
+<p>Use make to build and install Node (execute the following on the command line)</p>
+
+<pre><code>git clone https://github.com/joyent/node.git
+cd node
+export JOBS=2 # optional, sets number of parallel commands.
+mkdir ~/local
+./configure --prefix=$HOME/local/node
+make
+make install
+export PATH=$HOME/local/node/bin:$PATH
+</code></pre>
+
+<p>If you have any installation problems, look at <a href="https://github.com/ry/node/wiki/Troubleshooting-Installation">Troubleshooting
+Installation</a>, try an <a href="https://gist.github.com/579814">alternate installation method</a>, or stop into <a href="http://webchat.freenode.net/?channels=node.js&amp;uio=d4">#node.js</a> and ask questions.</p>
+
+<p><strong>Pre-built binaries</strong></p>
+
+<p>You can also install node from packages: [[Installing Node.js via package manager]]</p>
+
+<h3 id="Step-3b-Building-on-Windows">Step 3b - Building on Windows</h3>
+
+<p><strong>Pre-built binaries</strong></p>
+
+<p>Self-contained binaries are available at <a href="http://node-js.prcn.co.cc/">node-js.prcn.co.cc</a></p>
+
+<p><strong>Building from source</strong></p>
+
+<p>There are two ways of building Node on Windows. One is over the Cygwin
+emulation layer the other is using MinGW (GNU toolchain for
+windows). See the
+<a href="https://github.com/ry/node/wiki/Building-node.js-on-Cygwin-%28Windows%29">Cygwin</a>
+and <a href="https://github.com/ry/node/wiki/Building-node.js-on-mingw">MinGW</a>
+pages.</p>
+
+<p>Neither builds are satisfactorily stable but it is possible to get
+something running.</p>
+
+<h3 id="Step-4-Install-NPM">Step 4 - Install NPM</h3>
+
+<p><a name="Installing_npm"></a></p>
+
+<p>NPM is a package manager that has become the de-facto standard for
+installing additional node libraries and programs. Here's the quick
+and easy one-liner for installing on Unix.</p>
+
+<pre><code>$ curl http://npmjs.org/install.sh | sh
+</code></pre>
+
+<p>To install a library e.g. <a href="http://github.com/nodejitsu/jitsu">jitsu</a> ( The Nodejitsu deployment CLI tool )</p>
+
+<pre><code>$ npm install jitsu
+</code></pre>
+
+<p>And visit
+<a href="https://github.com/isaacs/npm" data-bare-link="true">https://github.com/isaacs/npm</a> for
+details.</p>
+
+<p><a name="New_to_Node"></a></p>
+
+<h2 id="New-to-Node-js-">New to Node.js?</h2>
+
+<p><strong>Don't be scared!</strong> There are plenty of resources out there for beginners. Here are just a few:</p>
+
+<ul>
+<li><a href="http://nodejs.org/docs/v0.4.8/api/">The nodejs.org Official Docs:</a></li>
+<li>The #Node.js, #nodejitsu and #nodesupport rooms on <a href="http://webchat.freenode.net/">irc.freenode.net</a></li>
+<li><a href="http://twitter.com/#!/NodeKohai">@NodeKohai on Twitter</a></li>
+</ul>
+
+
+<p><a name="Package_Json"></a></p>
+
+<h2 id="Understanding-the-package-json-format">Understanding the package.json format</h2>
+
+<p>A package.json file describes your application, its dependencies, and other various application configuration. For a detailed spec on creating a package.json you can check out Isaac's fine documentation <a href="https://github.com/isaacs/npm/blob/master/doc/developers.md#readme">here</a>.</p>
+
+<h2 id="Preparing-a-package-json-for-your-application">Preparing a package.json for your application</h2>
+
+<p>Nodejitsu requires that you create a valid <a href="#package_json" data-bare-link="true">package.json</a> for your application. The package.json will determine certain important pieces of information about your application which are required for deployment. Since sometimes it can get confusing when constructing your package.json file, we provide wizards in our CLI tool and on our website for creating one.</p>
+
+<p>Here is an example of what your package.json might look like:</p>
+
+<pre><code>{
+ "name": "hellonode",
+ "subdomain": "hellonode",
+ "scripts": {
+ "start": "server.js"
+ },
+ "version": "0.0.0"
+}
+</code></pre>
+
+<p>Notice the "scripts" property? This is where you'll store information about specific scripts in your application. The "start" property indicates the script that will get called when your application is started.</p>
+
+<h2 id="Specifying-dependencies-in-your-package-json">Specifying dependencies in your package.json</h2>
+
+<p>If your application requires additional dependencies or third-party libraries, Nodejitsu fully supports npm module dependency resolution. All you have to do is list your dependencies the exact same way you would if you were packaging a module for npm. Here is an example of the same package.json with a few dependencies.</p>
+
+<pre><code>{
+ "name": "hellonode",
+ "subdomain": "hellonode",
+ "scripts": {
+ "start": "server.js"
+ },
+ "dependencies": {
+ "async": "&gt;= 0.1.8",
+ "colors": "&gt;= 0.5.0",
+ "request": "&gt;= 1.9.0",
+ "vows": "&gt;= 0.5.8",
+ },
+ "version": "0.0.0"
+}
+</code></pre>
+
+<p>Your dependencies will be resolved when your application deploys to Nodejitsu.</p>
+
+</div>
+ </body>
</html>
View
BIN book.pdf
Binary file not shown.

0 comments on commit ec136e6

Please sign in to comment.
Something went wrong with that request. Please try again.