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

levelz-js

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

levelz-js

JavaScript Bindings for the LevelZ File Format

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

levelz-js

GitHub License GitHub package.json version Static Badge NPM Downloads

JavaScript Bindings for the LevelZ File Format

Overview

Provides JavaScript bindings for the LevelZ File Format.

Installation

System

# NPM
npm install levelz-js

# Yarn
yarn add levelz-js

# Bun
bun install levelz-js

Web

<!-- Use Minified Version -->
<script src="https://levelz-file.github.io/js-bindings/levelz.min.js"></script>

<!-- Use Readable Version -->
<script src="https://levelz-file.github.io/js-bindings/levelz.js"></script>

Usage

import { Coordinate2D } from 'levelz-js';

const coordinate = new Coordinate2D(1, 2);
console.log(coordinate.toString()); // [1, 2]
import * as fs from 'fs';
import { parseLevel } from 'levelz-js';

const txt = fs.readFileSync('my_level.lvlz', { encoding: 'utf-8' });
const level = parseLevel(txt);

console.log(level.headers.get('type')) // 3
import * as LevelZ from 'levelz-js'

const coordinate3D = new LevelZ.Coordinate3D(1, 2, 3);
console.log(coordinate3D.toString()); // [1, 2, 3]

const level = new LevelZ.Level2D({'type': '3', 'spawn', '[0, 0, 0]'});
console.log(level.toString()); // @type 3, @spawn [0, 0, 0]

Keywords

FAQs

Package last updated on 19 Sep 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