Coder Social home page Coder Social logo

jameskmonger / common Goto Github PK

View Code? Open in Web Editor NEW

This project forked from runejs/common

0.0 1.0 0.0 360 KB

Common logging, networking, compression, and other functionality for RuneJS applications.

License: GNU General Public License v3.0

TypeScript 100.00%

common's Introduction

RuneJS Discord Server

RuneJS

Common

Common logging, networking, compression, and other miscellaneous functionality for RuneJS.

Exported Modules

@runejs/common

  • logger is exported as a singleton Pino logging wrapper.
    • Methods:
      • logger.info(...messages: any[])
      • logger.debug(...messages: any[])
      • logger.warn(...messages: any[])
      • logger.error(...messages: any[])
      • logger.trace(...messages: any[])
      • logger.fatal(...messages: any[])
      • logger.destination(logDir: string)
      • logger.setOptions(options: Pino.LoggerOptions)
      • logger.setPrettyPrint(prettyPrint: boolean)
      • logger.setTimeFormat(format: TimeFn)
  • ByteBuffer is also exported at the root level.
    • Node Uint8Array wrapper with additional utility functions.
    • Unified configurable get and put methods to easily move bytes within the buffer.
    • Int24, Smart, Long and String type support.
    • Big endian, little endian, and mixed endian support.
    • Bit access through openBitBuffer(), putBits(), and closeBitBuffer()

@runejs/common/color

Handles various color conversions needed by the game and tooling.

  • RGB(A)
  • HSL (Hue, Saturation, Lightness)
  • HSV (Hue, Saturation, Value/Brightness)
  • HCL (Hue, Chroma, Luminance)
  • LAB (Lightness, A, B)

@runejs/common/compress

  • Exported class Gzip handles Gzip compression and decompression.
  • Exported class Bzip2 handles Bzip2 compression and decompression.

@runejs/common/crc32

Exports a single class Crc32 that generates CRC32 checksums for binary data files.

@runejs/common/encrypt

Provides XTEA encryption and decryption functionality, as well as a key file loader.

  • Exported as class Xtea

@runejs/common/net

  • SocketServer
    • Handles connections made to a RuneJS socket server.
  • SocketServer.launch(serverName, hostName, port, connectionHandlerFactory)
    • Spins up a new Node Socket server with the specified host and port.
  • ServerConfigOptions
    • Options for a configured Socket server, imported using the parseServerConfig() function.

common's People

Contributors

katilith avatar theblackparade avatar tynarus avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.