0

I generally work on my projects locally in Sublime Text but sometimes need to share them with others using things like Jsfiddle, codepen, or plunker. This is usually so I can get unstuck.

Is there an easier way to share code that doesn't involve purely copy pasting and the hassle of getting all the dependencies right in a new environment?

It's taking me hours to get some of my angular apps working in plunker and I'm wondering if there's a better way.

Kyle Pennell
  • 5,747
  • 4
  • 52
  • 75

1 Answers1

1

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.

Basically, what it will let you do is plunk [dir] from the commandline.

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

Geoff Goodman
  • 1,224
  • 9
  • 14