Skip to content

Save File Read/Writer for JavaScript (using WebAssembly)

License

Notifications You must be signed in to change notification settings

brickadia-community/node-brs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-brs

Wanna write Brickadia save files but the thought of learning Rust makes your joints crumble? Thats ok! I suffered for you and you can now use this implementation to write Brickadia save files using node.js.

The original implementation is avaliable under brickadia/brs.

Usage

Firstly, install:

npm install --save cheezbarger/node-brs
    const brs = require('node-brs');
    // Thats it!

All functions and classes come exposed in the default module, classes have predefined default values which are formatted appropriately, change what you need.

The library comes with a prebuilt WebAssembly module so you dont have to build it yourself. Should you want to, run the build command:

npm run build

Reading

Reading files is super simple

    const brs = require('./../node-brs');
    const data = brs.readSave('myBuild.brs');

Writing

Writing save files is super easy, first off you need to familiarize yourself with the save format which you can get using brs.readSave, then you can just edit the returned JSON and write your new save.

    const {readSave, writeSave} = require('node-brs');

    const ex = readSave('myBuild.brs');
    ex.description = 'WD40';

    writeSave('myBuild.brs', ex);

Want to start from scratch?

    const {writeSave, WriteData} = require('node-brs');

    const save = new WriteData();
    save.description = 'Rust free!';

    writeSave('myBuild.brs', save);

About

Save File Read/Writer for JavaScript (using WebAssembly)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 94.7%
  • Rust 5.3%