Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including surge with all npm packages installed. Try it out:

var surge = require("surge")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

surge v0.19.0

CDN for front-end developers


Publish web apps to a CDN with a single command and no setup required.


This is the CLI client for the hosted service. It’s what gets installed when you run npm install -g surge.

This CLI library manages access tokens locally and handles the upload and subsequent reporting when you publish a project using surge.


It’s easier to show than tell so let’s get to it! The following command will deploy the current working directory to the surge servers where the application will be available at

$ surge ./

Run surge --help to see the following overview of the surge command...

  Surge – Single-command web publishing. (v0.17.6)

    surge [options]

    -p, --project       path to projects asset directory (./)
    -d, --domain        domain of your project (<random>
    -a, --add           adds user to list of collaborators (email address)
    -r, --remove        removes user from list of collaborators (email address)
    -V, --version       show the version number
    -h, --help          show this help message

  Shorthand usage:
    surge [project path] [domain]

  Additional commands:
    surge whoami        show who you are logged in as
    surge logout        expire local token
    surge login         only performs authentication step
    surge list          list all domains you have access to
    surge teardown      tear down a published project

    Getting started
    Custom domains
    Additional help

  When in doubt, run surge from within your project directory.

CDN Features

  • Custom CNAME & custom SSL
  • Fallback 404.html pages
  • HTML5 mode 200.html pages
  • Stays out of gits way
  • Supports clean URLs && trailing slashes /
  • Implicit signup
  • Supports CNAME files

If you’re using tools like Grunt, Gulp, or a static site generator like Jekyll, your files are output into a compile directory like _site/, build/, or www/. From the root of your project, pass Surge the path to this directory to upload your compiled assets.

surge www

You may also add this directory to your .gitignore to keep your compiled assets out of your Git history.


RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free