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

eyeliner

Has an itch needing to be scratched.
Member
Joined
Feb 17, 2006
Messages
2,905
Trophies
2
Age
44
XP
5,608
Country
Portugal
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.
 

Ericthegreat

Not New Member
Member
Joined
Nov 8, 2008
Messages
3,455
Trophies
2
Location
Vana'diel
XP
4,317
Country
United States
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?
 

XorTroll

Switching between my 2DS and my Switch
OP
Developer
Joined
Dec 28, 2017
Messages
643
Trophies
1
Location
Nowhere
Website
github.com
XP
4,270
Country
Spain
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
 

XorTroll

Switching between my 2DS and my Switch
OP
Developer
Joined
Dec 28, 2017
Messages
643
Trophies
1
Location
Nowhere
Website
github.com
XP
4,270
Country
Spain
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,

Enlapse

Well-Known Member
Member
Joined
Dec 21, 2014
Messages
276
Trophies
0
XP
1,095
Country
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.
 

XorTroll

Switching between my 2DS and my Switch
OP
Developer
Joined
Dec 28, 2017
Messages
643
Trophies
1
Location
Nowhere
Website
github.com
XP
4,270
Country
Spain
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
 

LSolrac

Well-Known Member
Newcomer
Joined
Oct 26, 2015
Messages
61
Trophies
0
Age
28
XP
418
Country
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?
 

Hambrew

Well-Known Member
Member
Joined
Oct 9, 2018
Messages
597
Trophies
0
Location
Yoyle City
XP
1,600
Country
United States
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)
 

LSolrac

Well-Known Member
Newcomer
Joined
Oct 26, 2015
Messages
61
Trophies
0
Age
28
XP
418
Country
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.
 

Red1Reaper

Asperger Dude
Member
Joined
Feb 5, 2017
Messages
339
Trophies
0
Age
27
Location
Valencia, Rafelbuñol
XP
661
Country
Spain
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

General chit-chat
Help Users
    MysticStarlight @ MysticStarlight: https://www.youtube.com/watch?v=PLg85Bwkfmo