Socket
Book a DemoInstallSign in
Socket

langium

Package Overview
Dependencies
Maintainers
4
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

langium

A language engineering tool for the Language Server Protocol

4.0.0
latest
Source
npmnpm
Version published
Weekly downloads
1M
0.88%
Maintainers
4
Weekly downloads
 
Created

What is langium?

Langium is a tool for developing domain-specific languages (DSLs) and language servers. It provides a framework for creating custom languages with a focus on language design, parsing, and tooling support.

What are langium's main functionalities?

Language Definition

Langium allows you to define a custom language using a grammar syntax. This code sample demonstrates how to define a simple DSL with a model and elements using Langium's grammar services.

const { createLangiumGrammarServices } = require('langium');
const services = createLangiumGrammarServices();
const grammar = `grammar MyDSL
entry Model:
    'model' name=ID '{'
        (elements+=Element)*
    '}';
Element:
    'element' name=ID;`;
services.GrammarParser.parse(grammar);

Language Server

Langium can be used to create a language server that provides IDE features like auto-completion and error checking for your custom language. This code sample shows how to start a language server for a simple DSL.

const { startLanguageServer } = require('langium');
startLanguageServer({
    grammar: `grammar MyDSL
entry Model:
    'model' name=ID '{'
        (elements+=Element)*
    '}';
Element:
    'element' name=ID;`,
    port: 5000
});

Other packages similar to langium

Keywords

language

FAQs

Package last updated on 31 Jul 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

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.