Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

elmajs

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

elmajs

Elasto Mania NPM package to read, modify and write Elma files

  • 1.2.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9
increased by200%
Maintainers
1
Weekly downloads
 
Created
Source

Release npm npm bundle size codecov

elmajs

Elasto Mania NPM package for working with all main game files: levels, replays, LGRs and state.dat.

Install

npm install elmajs --save

Documentation and usage

See https://elmadev.github.io/elmajs/ for extended documentation. You will find the repository here: https://github.com/elmadev/elmajs

Opening and editing a level file in Node.js

const fs = require('fs');
const { Level } = require('elmajs');

const fileBuffer = fs.readFileSync('C:/EOL/lev/groof89.lev');
const level = Level.from(fileBuffer);
level.name = 'rename level';
level.top10.single = []; // remove single player best times list
fs.writeFileSync('testlev.lev', level.toBuffer());

Using UMD bundle in browser directly

<head>
  <script src="https://unpkg.com/elmajs@1.0.2/umd/main.js"></script>
  <script>
    (async () => {
      const file = await fetch('https://eol.ams3.digitaloceanspaces.com/replays/vq0y3cwqfn/37Spef5269.rec');
      const buffer = await file.arrayBuffer();
      const rec = ElmaJS.Replay.from(buffer); // the UMD bundle adds a ElmaJS global variable with all functionality

      const info = document.getElementById('info');
      // returns whether ride in replay is finished (has a touch event as the final event)
      // and the time (if finished, exact same of event -- otherwise approximation based on frame count or a touch event)
      const { finished, time, reason } = rec.getTime();
      info.innerHTML = `${rec.level}: ${time}`; // QWQUU037.LEV: 52690
    })()
  </script>
</head>

<body>
  <div id="info"></div>
</body>

Contribute

  1. Fork this project
  2. Enter the following:
git clone https://github.com/YOUR-NAME/elmajs.git
cd elmajs
yarn
  1. Create your changes.
  2. yarn test and make sure everything passes.
  3. Send a pull request!

Do not modify any of the tests unless you know there is a mistake, or you need to add a new test for a new feature, or if something is missing.

Issues

If you spot any errors, make a new issue and write as many details as you can regarding the error.

Keywords

FAQs

Package last updated on 16 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc