Uploading files to Plunker

Serge van den Oever picture Serge van den Oever · Feb 4, 2014 · Viewed 10.6k times · Source

Is there any way to upload multiple files to http://plnkr.co, instead of copy-pasting the code all the time? Would be great if a plunker could be connected to a github repository, or if a set of files could be dragged in.

Answer

Geoff Goodman picture Geoff Goodman · Aug 18, 2014

There is no built-in way to upload multiple files to Plunker.

Users have built tools to facilitate this. Please see: https://www.npmjs.org/package/plunk which is a command-line utility that will let you create plunks from the contents of a directory.

You can also bootstrap plunks by making POST requests to http://plnkr.co/edit/ where the payload has the following format:

{
  "description": "Plunk description", // Optional
  "tags": ["tag1", "tag2", ..., "tagN"], // Optional
  "files": {
    "filename1.ext": "contents of filename1.ext",
    "filename2.ext": "and so on.."
  }
}

Code for this handler: https://github.com/filearts/plunker_www/blob/0c608ae80ef30d59bfdfeaf3c2a28563f7b730e4/app.coffee#L105-L121