jackfranklin / pulldown

The minimal JavaScript package manager.
175 stars 7 forks source link

Make it useful as a module #61

Closed jackfranklin closed 11 years ago

jackfranklin commented 11 years ago

@phuu I think you'll be interested in this.

Right now if you require in Pulldown, it's always going to download the files you pass it.

new Pulldown().init(["jquery", "backbone"], function() {
// urls downloaded
});

But what I think we want is a way to just get it to return the URLs it would have downloaded, right?

new Pulldown({ returnUrls: true }).init(["jquery", "backbone"], function(jquery, backbone) {
  console.log(jquery); //=> https://cdnjs.com/blah/blah/jquery.js
  console.log(backbone); //=> https://cdnjs.com/blah/blah/backbone.js
});

Right?

tgvashworth commented 11 years ago

Hmm. Possibly, although for pldn.io the string contents of the file is the useful bit. We should Skype soon to talk about it.

jackfranklin commented 11 years ago

Yeah I think so. Easier than continuing this here.

jackfranklin commented 11 years ago
new Pulldown({ returnStringContent: true }).init(["jquery", "backbone"], function(jquery, backbone) {
  console.log(jquery); //=> "window.jQuery = function() ...."
  console.log(backbone); //=> "window.Backbone = ..."
});