🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

com.hydroperfox.tmlanguage.yaml2json

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

com.hydroperfox.tmlanguage.yaml2json

Convert YAML TMLanguage syntax with variables to JSON format.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

tmlangyaml2json

Convert a tmLanguage written in YAML to JSON.

Features:

  • Variable replacement using the {{variableName}} syntax.

Note this was repository had to be recreated as I deleted it previously.

Usage

Install with:

npm i -g com.hydroperfox.tmlanguage.yaml2json

Write a file mylanguage.tmLanguage.yaml:

# tmLanguage
---

$schema: https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json
name: MyLanguageName
scopeName: source.mylang

variables:
  someVar: 'xxx'

patterns:
  - include: '#foo'

repository:
  foo:
    patterns: []

Then run:

tmlangyaml2json mylanguage.tmLanguage.yaml mylanguage.tmLanguage.json

The output looks like follows:

{
    "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
    "name": "MyLanguageName",
    "patterns": [
        {
            "include": "#foo"
        }
    ],
    "repository": {
        "foo": {
            "patterns": []
        }
    },
    "scopeName": "source.mylang"
}

FAQs

Package last updated on 24 Jan 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