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

parse-lfs-message

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-lfs-message

Convert LFS Message to UTF-8

  • 1.2.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
increased by40%
Maintainers
2
Weekly downloads
 
Created
Source

parse-lfs-message

NPM Version Node.js CI

Convert a Live for Speed message to UTF-8

This module is designed to be used with NodeJS on the server with xi4n or as middleware for other LFS InSim applications. This module will parse any LFS message (chat message, nickname, server name etc.), converting encoded Windows codepage characters to UTF-8. This module leaves message colour encodings intact for processing later.

Install

# Install with Yarn
yarn add parse-lfs-message

# Install with NPM
npm i parse-lfs-message

Usage Example

You can run the example with yarn example or npm run example.

// Require parse-lfs-message module
const parseLFSMessage = require("parse-lfs-message");

// Simulate receiving messages from a buffer
const msg1 = Buffer.from("^72^45 ^7B2^J^4Ï^1 Ayoub", "binary");
const msg2 = Buffer.from("^405 ^J¢^7ϧ^4£ ^7TJ", "binary");

// Parse messages
const parsedMsg1 = parseLFSMessage(msg1);
const parsedMsg2 = parseLFSMessage(msg2);

console.log(parsedMsg1);
// Output: ^72^45 ^7B2^4マ ^1Ayoub

console.log(parsedMsg2);
// Output: ^405 「^7マァ^4」 ^7TJ

FAQs

Package last updated on 14 Apr 2023

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