• @boneskull
    RE npm leads to per-user fixes:
    When a library is pulled down to local file system, and the user finds a bug - and the fix - it's very convenient to simply fix the problem locally. Of course this is a completely wrong approach but users tend to bend the rules. With the current way things work, the only way to fix a bug is to fix it for everyone. Which is good.

    What scenario do you want to realize with an API?
    What are you trying to do with the espruino-tools that you're having problems with?
    I'm pulling it in with npm as such: dependencies: { "espruino-tools": "git+https://<token-from-github>:x-oauth­-basic@github.com/espruino/espruino-tool­s.git" /*...*/ }

    Then

    var spawn = require('child_process').spawn;
    var child = spawn('node', ['/path/to/espruino-tools/index.js', '-p', '/dev/ttyACM1', 'mycode.js']);
    
    child.stdout.on('data', function(stream) {
      //look at result of espruino-tools
    });
    

    *This is written from memory on my windows disc, the code is on linux so may be something wrong. Let me know if you want me to post the real stuff...

About