Socket
Book a DemoInstallSign in
Socket

@discord/intl-flat-json-parser

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@discord/intl-flat-json-parser

Rust-based JSON parser with location information for flat objects.

latest
Source
npmnpm
Version
0.26.0-rc.2
Version published
Maintainers
1
Created
Source

intl_flat_json_parser

A Rust-based JSON parser with location information for flat objects, used by @discord/intl-message-database to provide more accurate diagnostics for values parsed out of JSON files.

The parser is specifically built to only understand a flat, well-formed object structure and has minimal error recovery, but fully supports Unicode and other JSON string syntax like escapes.

Install

pnpm add @discord/intl-flat-json-parser

Usage

import { parseJson, parseJsonFile } from '@discord/intl-flat-json-parser';

// Parse a string as flat JSON
const jsonContent = `{
  "MESSAGE_ONE": "Hello, this is the first message",
  "MESSAGE_TWO": "Another message!"
}`;

const messages = parseJson(jsonContent);
console.log(messages[0]);
//=> {
//   key: "MESSAGE_ONE",
//   value: "Hello, this is the first message",
//   position: {
//     line: 2,
//     col: 19
//   }
// }

// Or pass a file path to get parsed directly from the file system
const directMessages = parseJsonFile('some/file/path.json');

FAQs

Package last updated on 11 Aug 2025

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