Allow custom modules for apps

pull/608/head
Gordon Williams 2020-12-09 13:43:29 +00:00
parent 6a63a6ea47
commit 4c78076603
4 changed files with 25 additions and 1 deletions

View File

@ -394,6 +394,18 @@ It should also add `app.json` to `data`, to make sure it is cleaned up when the
},
```
## Modules
You can include any of [Espruino's modules](https://www.espruino.com/Modules) as
normal with `require("modulename")`. If you want to develop your own module for your
app(s) then you can do that too. Just add the module into the `modules` folder
then you can use it from your app as normal.
You won't be able to develop apps using your own modules with the IDE,
so instead we'd recommend you write your module to a Storage File called
`modulename` on Bangle.js. You can then develop your app as normal on Bangle.js
from the IDE.
## Coding hints
- use `g.setFont(.., size)` to multiply the font size, eg ("6x8",3) : "18x24"

2
core

@ -1 +1 @@
Subproject commit 0389671ba6678a12c9f35644ffb96c190bbe0278
Subproject commit 8bfdeebf705ced95699dcbbccfa05a99e7d3f4a9

9
modules/README.md Normal file
View File

@ -0,0 +1,9 @@
App Modules
===========
These are modules used by apps - you can use them with:
```
var testmodule = require("testmodule");
testmodule.test()
```

3
modules/testmodule.js Normal file
View File

@ -0,0 +1,3 @@
exports.test = function() {
console.log("Hello world!");
};