Homebrew RELEASE Brew.js - Make homebrew apps with JavaScript!

  • Thread starter Thread starter XorTroll
  • Start date Start date
  • Views Views 46,448
  • Replies Replies 109
  • Likes Likes 43
May I ask for a concise walkthrough for making this work, either in an emulator or a real system?

I've got all files in the repository, but I lack the knowledge to make things run, because I never really meddled with homebrew (only a wee bit in the DS, but I mostly forgot it all).

I would sing songs about you and your heroic deeds.
 
Brew.js - Make homebrew apps with JavaScript!

39009792


Check out Brew.js's website for documentation and info: https://brewjs.github.io
I really recommend you joining our Discord server (https://discord.gg/Qqnndqd), because I'm everyday on Discord posting doubts or ideas about Brew.js


- About this project

Brew.js consists on a number of interpreters (and I also plan to develop app makers) to develop and run JavaScript apps, supporting plain JavaScript and also supporting native platform functions, to develop real homebrew apps.

- API and JavaScript source

For support and info, check the ChangeLog of the latest version ()
- Support info

IMPORTANT - AFAIK, Brew.js doesn't work on Yuzu.
(for those who care, the reason is that Yuzu fails when accessing RomFS items of the ROM)

For the moment, only Switch is supported.
Support is planned for GBA, NDS, 3DS, GameCube, Wii and Switch.

- Using the interpreter

A project is a folder containing JavaScript files, plus a package.json package file. (This file is required!)
The sources are loaded in alphabetical order, no matter the name they have.

Switch:
Simply download latest release and copy the "switch" folder in your SD card. Now, you can create and save your projects.
Save projects here: sdmc:/switch/Brew.js/<yourproject>

(no more platforms for the moment)

- Documentation and examples

You have the documentation on Brew.js's website. (see above)
You have JavaScript examples at GitHub, attached to the latest release!

- Download and repository

Current release version: 1.0
This project is open-source, hosted at a GitHub organisation: https://github.com/BrewJS
Switch: https://github.com/BrewJS/Switch/releases/latest

Enjoy scripting!

Copyright © 2018, by XorTroll
So can this run a react.js project, or plain node only?
 
Anyway guys, as now 2.0 (early) sources are published in GitHub, you can try building it by yourselves.
Brew.js 2.0 is currently on a usable state, but much API still needs to be added. Anyway, it should run properly.
Read the documentation for more info! https://xortroll.github.io/Brew.js
 
Recent news from 2.0 development:

After some tests I managed to call IPC commands from Brew.js.
What does this mean?
Code:
var ps = require("pegaswitch");
var fsp = new ps.Service("fsp-srv");
Yay, a PegaSwitch module is coming! I'll to try to port as much IPC stuff as I can!
(obviously, the module is for Nintendo Switch only)

Anyway, currently achieved stuff:
- The C++ API is close to get finished, most stuff is added...

- There will probably be an OpenGL module for Switch!

- We have callbacks and classes, so porting Node.js stuff is even easier!
 
Last edited by XorTroll,
This is fantastic! Wow.
I am not sure if I am asking a silly question, but: Would this support AJAX or does it have some kind of workaround? If so, it'd brilliant.

Thank you.
 
Some news of 2.0 development:

- IPC command support on PegaSwitch module keeps getting improved, fixing X descriptors this time (managed to get "fsp-srv" service, initialize it, get the handle of the sd card filesystem and create a folder there, all from JS!)
- I've decided to make a new tool, along with the interpreter: a remote interpreter! What does this mean? Just load the homebrew interpreter, then open the PC client on your PC and you can type JS on the client to run it on your switch! The client looks like Node.js REPL!
- Node.js ported module's functions now are almost the same, as Brew.js supports callbacks and classes now. The only difference is that callbacks are called synchronously and not asynchronously as Node.js does, but I hope that someday I'll find the way to fix that.

If you want to take a look of how Brew.js 2.0's dev is going, check GitHub: https://github.com/XorTroll/Brew.js

Anyway, here you have a screenshot of the PC client: (that JS code should eject the SD card via "ns:am" IPC commands, and worked!)

client.PNG
 
I'll be honest, I was thinking of getting into this and porting over RPG Maker MV's web player. If not make a small game engine with existing libraries.
Is HTML5 or WebGL still feasable or not planned for 2.0?
 
oh boy oh boy NESBOX, amiright? I hope there'll be a Flash player for the switch, Jacknjellify make some epic flash games (jacknjellify made bfdi, bfdia, idfb, and bfb)
 
oh boy oh boy NESBOX, amiright? I hope there'll be a Flash player for the switch, Jacknjellify make some epic flash games (jacknjellify made bfdi, bfdia, idfb, and bfb)
Personally I think it'd be best to port Pepperflash or an old Open Source Flash Player. However, Pepperflash would still need a web viewer, I imagine.
 
Is this capable of communicating with a node server on a computer? like being able from the switch to tell a node server on a computer to run a function? and receive data from that server?
I am the dev of the Graphical Interface for lan play, i made that thing on electron, i was wondering if it would be possible with this to create a switch hb app capable of controlling the GUI in the computer? like request the server list from the computer app, and ordering the computer app to do something(changing order of the server list, update info, add a server, launch lan play, run functions basically)
basically i only need 2 things
-Being able to request data from a remote node server on the same lan as the switch
-Being able to run functions on that remote node server on the same lan as the switch from the switch
Thanks!

EDIT:

Now i only would need the ability to fetch if i can fetch a url and get json from it is all i need
 
Last edited by Red1Reaper,

Site & Scene News

Popular threads in this forum