Package Manager

Posted on
  • Is there a package manager planned for Espruino? If not, could there be?

    I ask simply because I am working on a good number of libraries to speak to a number of different modules, and I plan on shoving most of them as public on my GitHub account, along with blog posts explaining how they work, etc. However, I have been thinking it could be nice to have a central place for people to search and find these libraries or "packages".

    If there is anything I can do to help make this happen, please let me know. I love the concept of Espruino, and it's going to simplify a lot of my future projects (or at least the prototypes!).

  • At the moment we have a curated set of modules that are built from https://github.com/espruino/EspruinoDocsĀ­

    Not only that but each one has documentation that appears on the website and is searchable. It's also linked into the rest of the site, so everything stays in sync and appears in http://www.espruino.com/Modules, but if you make a new Accelerometer module it'll automatically get linked from the Accelerometer page too... Or if someone writes a tutorial using your module then that'll get linked to from your module's page.

    If you want to add a module to the list, it's best if you just follow what's here: http://www.espruino.com/Writing+Modules and issue a pull request.

    It's not quite a package manager, but it works pretty well at the moment. It also means I can run packages through a minifier by default, which saves a lot of RAM in Espruino and speeds it up.

  • Also, just to say that you can do: require("http://www.espruino.com/modulesĀ­/DS18B20.js") (for example) so you can load modules directly from another site.

    However:

    • v36 of the Web IDE has a bug where the URL must start with http://www. or https://www.
    • Javascript cross-site scripting restrictions mean that your website must have a Access-Control-Allow-Origin header - which GitHub doesn't
  • Excuse the slow reply, it's been quite a busy day!

    It's not quite what I had in mind, but I imagine it works just fine for now while the list is quite short. Once the list becomes a bit bigger though, it may need splitting up into categories, but that's a task that can wait until it's a problem I imagine!

    As for the CORS issue, would the JSONP with callback trick not work?

  • Yes - later on it might be an issue, however hopefully then I might be in a position to dedicate more manpower to it :)

    JSONP with callback? Do you have a link? If you can get it working it'd be awesome (code here ) - it would probably be a useful utility function to have as the Web IDE often loads files from URLs...

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Package Manager

Posted by Avatar for Cyber-Lane @Cyber-Lane

Actions