Creates a simple web server for a directory

npm install servedir
1 downloads in the last day
32 downloads in the last week
147 downloads in the last month


servedir is a simple Node web server for offline development and testing: running servedir from a directory will create a quick local web server. servedir is useful for developing scripts that require a standard web environment and can't use the file:// protocol.

The annotated source code is included in the docs/ folder.


Check out a working copy of the source code with Git, or install servedir via npm. The latter will also install servedir into the system's bin path.

$ git clone git://
$ npm install servedir -g

Alternatively, servedir can be run directly from the repository using Node:

$ node bin/servedir
$ ./bin/servedir


servedir [path] [port]

  • path - The location to serve files and directories from. Defaults to the current working directory.
  • port - The port number. Default to 8000.


$ servedir ~/Documents/example 8001
$ servedir ~/Documents/example
$ servedir 8001
$ servedir


npm loves you