Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build and deploy framework for NodeJS

Tags:

node.js

I've been looking around for a Java maven equivalency for NodeJS but can't really seem to find one so I'm posting this question to see whether there're a combination of tools/framework I can use to build and deploy Node. The specific tasks I'm looking for is:

  • Being able to grab dependent modules for a checked out code NodeJS project (for ex. Express or stuff like that)
  • Set up a private repository for NodeJS modules for in-house projects
  • Package with dependencies and make releases of Node projects to a repository (sorta like war)
  • Deploy a release to a remote box and fire up Node

Any help would be greatly appreciated!!!

like image 922
Long Ho Avatar asked Oct 06 '11 01:10

Long Ho


1 Answers

Npm does most of that for you.

Dependency handling:

  1. Create a package.json for your project (see required contents or use npm init)
  2. Commit it along your project files, this will be your dependency tracking
  3. npm install will sort out and download all dependencies

Deploying:

  1. Upload/push your files to the server
  2. Either send the node_modules folder along or run npm install on the server
  3. To use your private libraries you'll need to either upload the modules folder or publish them (see below)

Private/local libraries:

  1. Create the library anywhere you want (e.g. ~/Projects/mylib)
  2. go to the mylib folder and run npm link
  3. go to the project's folder and run npm install mylib
  4. Now your local library is symlinked into your project's node_modules

To set up a private repository for your modules, follow these instructions

like image 156
Ricardo Tomasi Avatar answered Oct 25 '22 05:10

Ricardo Tomasi