Adding JS module that is local to a project #750
Unanswered
espruino-discuss
asked this question in
JavaScript
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2017-09-26 by phil303
Hi,
I took a gander at the source code here. And while I'm not amazing at reading C, I can read comments. It looks like currently there's no way to load a file that is co-located within the same folder.
I have a project that has a bunch of other stuff besides the Espruino code so I'm trying to avoid using the Espruino playground folder since that wouldn't be under the same source control. For more context, my project directory structure is:
LEDserver.js
is basically a server that understands some animation binary data from a request.warningGif.js
is a file with a pre-built animation I'd like to load when things go awry, like one of the incoming frames eating up too much current. It doesn't seem like this is possible in the current setup.I even tried hacking this a bit, allowing NPM in the Web IDE settings, and using a
node_modules
folder to housewarningGif.js
but alas, this refuses to upload to the device (an ESP32).I'm not sure I'd be able to do it but I wouldn't mind trying. If I pulled together some C code to look up a file locally and made a PR, would that be something folks would be interested in? Is there some technical reason you can't do this?
Beta Was this translation helpful? Give feedback.
All reactions