Skip to content

Working on Muttlee

Peter Kwan edited this page Jun 26, 2025 · 7 revisions

Using Github on a Raspberry Pi

Github is documented very well but I can never remember any of it. My kind of instruction manual On a Raspberry Pi this is what I do. This assumes that Muttlee has already been installed using Git.

Before doing anything, update your local repo.

git pull origin master

Then when you create something like digitiser2k.html

git add digitiser2k.html
git commit -m "New digitiser 2000 service"
git push origin master

Testing Muttlee

Muttlee's code begins with teletextserver.js. pm2 is Node's process manager that starts up the server automatically. It can also be started and stopped manually.

pm2 stop teletextserver
pm2 start teletextserver

Once stopped, you can run teletextserver manually and see the console logs etc.

node teletextserver.js

Updating npm

Go to the Muttlee folder and type

npm outdated

If packages are outdated you can type

npm update 

This might also uncover renamed packages. These are bad because they will not be updated because the old version is left so it won't break old packages. It might also discover version problems and suggest that you do

sudo npm i npm@latest -g

Lint

I use standardJS to lint the code as it works with Node. Using the --fix option writes back the file with the simple fixes done. It will remove semicolons that don't need to be there and pretty print among other things. You should also look at the output for errors that it can not fix.

Install and run

sudo npm install standard --global

And then to run it use commands like this:

standard teletextserver.js --fix
standard public/*.js --fix

Manual fixups

Because p5 drops in a lot of globals that aren't declared locally, standardJS thinks that they are undefined. The cure is to add a line declaring these globals to standardJS.

/* globals constrain, */

Clone this wiki locally