JavaScript Syntax

Open-source JavaScript projects categorized as Syntax

Top 18 JavaScript Syntax Projects

  • visual-studio-code

    An arctic, north-bluish clean and elegant Visual Studio Code theme.

    Project mention: Solarized dark for me. | /r/ProgrammerHumor | 2023-02-20

    Nord by arcticicestudio

  • starry-night

    Syntax highlighting, like GitHub (by wooorm)

    Project mention: Shiki Syntax Highlighter | news.ycombinator.com | 2023-03-06

    Related and similar, there's also starry-night: https://github.com/wooorm/starry-night

  • Appwrite

    Appwrite - The Open Source Firebase alternative introduces iOS support . Appwrite is an open source backend server that helps you build native iOS applications much faster with realtime APIs for authentication, databases, files storage, cloud functions and much more!

  • refractor

    Lightweight, robust, elegant virtual syntax highlighting using Prism

  • lowlight

    Virtual syntax highlighting for virtual DOMs and non-HTML things

  • metho

    A new method for methods

    Project mention: CSS is awesome | /r/ProgrammerHumor | 2022-11-29
  • astq

    Abstract Syntax Tree (AST) Query Engine

    Project mention: Navigate ASTs with x-path-like queries | /r/javascript | 2022-06-30
  • notepadplusplus

    An arctic, north-bluish clean and elegant Notepad++ theme.

  • Klotho

    AWS Cloud-aware infrastructure-from-code toolbox [NEW]. Build cloud backends with Infrastructure-from-Code (IfC), a revolutionary technique for generating and updating cloud infrastructure. Try IfC with AWS and Klotho now (Now open-source)

  • postcss-less

    PostCSS Syntax for parsing LESS

  • tree-sitter-sql

    SQL syntax highlighting for tree-sitter

    Project mention: Emacs and Java Development: Corfu + Cape + LSP-Mode + Treesit | /r/emacs | 2023-05-19

    (use-package treesit :ensure nil :custom ;; Some stuff taken from here: https://robbmann.io/posts/emacs-treesit-auto/ (treesit-extra-load-path '("/usr/lib64/")) (treesit-language-source-alist '((bash . ("https://github.com/tree-sitter/tree-sitter-bash")) (c . ("https://github.com/tree-sitter/tree-sitter-c")) (c++ . ("https://github.com/tree-sitter/tree-sitter-cpp")) (csharp . ("https://github.com/tree-sitter/tree-sitter-c-sharp")) (css . ("https://github.com/tree-sitter/tree-sitter-css")) (elixir ("https://github.com/elixir-lang/tree-sitter-elixir")) (html . ("https://github.com/tree-sitter/tree-sitter-html")) (java . ("https://github.com/tree-sitter/tree-sitter-java")) (javascript . ("https://github.com/tree-sitter/tree-sitter-javascript")) (json . ("https://github.com/tree-sitter/tree-sitter-json")) (lua . ("https://github.com/Azganoth/tree-sitter-lua")) (makefile . ("https://github.com/alemuller/tree-sitter-make")) (org . ("https://github.com/milisims/tree-sitter-org")) (python . ("https://github.com/tree-sitter/tree-sitter-python")) (tsx . ("https://github.com/tree-sitter/tree-sitter-typescript" "master" "tsx/src")) (typescript . ("https://github.com/tree-sitter/tree-sitter-typescript" "master" "typescript/src")) (ruby . ("https://github.com/tree-sitter/tree-sitter-ruby")) (rust . ("https://github.com/tree-sitter/tree-sitter-rust")) (sql . ("https://github.com/m-novikov/tree-sitter-sql")) (toml . ("https://github.com/tree-sitter/tree-sitter-toml")) (yaml . ("https://github.com/ikatyang/tree-sitter-yaml")))) (major-mode-remap-alist '((c-mode . c-ts-mode) (c++-mode . c++-ts-mode) (csharp-mode . csharp-ts-mode) (css-mode . css-ts-mode) (html-mode . html-ts-mode) (java-mode . java-ts-mode) (js-mode . js-ts-mode) (json-mode . json-ts-mode) (makefile-mode . makefile-ts-mode) ;; (org-mode . org-ts-mode) ;; not mature yet (python-mode . python-ts-mode) (typescript-mode . typescript-ts-mode) (ruby-mode . ruby-ts-mode) (rust-mode . rust-ts-mode) (toml-mode . toml-ts-mode) (yaml-mode . yaml-ts-mode))) (treesit-auto-fallback-alist '((toml-ts-mode . conf-toml-mode) (typescript-ts-mode . nil) (tsx-ts-mode . nil))) (treesit-font-lock-settings t) (treesit-simple-indent t) (treesit-defun-type-regexp t)) (use-package treesit-auto :demand t :config (setq treesit-auto-install t) (global-treesit-auto-mode))

  • sugar-high

    ✏️ Super lightweight JSX syntax highlighter, around 1KB after minified and gzipped

  • remark-highlight.js

    Legacy plugin to highlight code blocks with highlight.js — please use `rehype-highlight` instead

  • postcss-syntax

    Automatically switch PostCSS syntax based on file extensions

  • langua

    A suite of language tools

  • parsejevko.js

    [DEPRECATED] Deprecated in favor of https://github.com/jevko/jevko.js

    Project mention: November 2022 monthly "What are you working on?" thread | /r/ProgrammingLanguages | 2022-11-03

    Besides that I wrote some parsers in various languages. The most mature is the JS one: https://github.com/jevko/parsejevko.js

  • doku.js

    A Simple Text/Document Viewer written in JS

    Project mention: doku.js: A text and document viewer with custom documentation language | /r/javascript | 2022-08-24
  • markup-experiments

    A collection of experiments with Jevko and text markup.

    Project mention: Jevko: a minimal general-purpose syntax | news.ycombinator.com | 2022-10-25

    Responding to some points I left off here https://news.ycombinator.com/item?id=33336789

    I guess the main one is this:

    > If your audience is people like me, I think it would probably be worthwhile for you to spend some time up front describing the intended semantics of a data model, as I've attempted above, rather than leaving people to infer it from the grammar. (Maybe OCaml is not a good way to explain it, though.) You might also want to specify that leading and trailing whitespace in prefixes is not significant, though it is in the suffix ("body"); this would enable people to format their name-value pairs readably without corrupting the data. As far as I can tell, this addendum wouldn't interfere with any of your existing uses for Jevko, though in some cases it would simplify their implementations.

    You're right, things should be explained more clearly (TODO). Especially the exact role of Jevko and treatment of whitespace. I'll try to improve that.

    Here is a sketch of an explanation.

    Plain Jevko is meant to be a low-level syntactic layer.

    It takes care of turning a unicode sequence into a tree.

    On this level, all whitespace is preserved in the tree.

    To represent key-value pairs and other data, you most likely want another layer above Jevko -- this would be a Jevko-based format, such as queryjevko (somewhat explained below) or, a very similar one, easyjevko, implemented and very lightly documented here: https://github.com/jevko/easyjevko.js

    Or you could have a markup format, such as https://github.com/jevko/markup-experiments#asttoxml5

    This format layer defines certain restrictions which may make a subset of Jevkos invalid in it.

    It also specifies how to interpret the valid Jevkos. This includes the treatment of whitespace, e.g. that a leading or trailing whitespace in prefixes is insignificant, but conditionally significant in suffixes, etc.

    Different formats will define different restrictions and interpretations.

    For example:

    # queryjevko

    queryjevko is a format which uses (a variant of) Jevko as a syntax. Only a subset of Jevko is valid queryjevko.

    > I think this is a more useful level of abstraction, and it's more or less the level used by, for example, queryjevko.js's jevkoToJs, although that erroneously uses () instead of [].

    The `()` are used on purpose -- queryjevko is meant to be used in URL query strings and be readable. If square brackets were used, things like JS' encodeURIComponent would escape them, making the string unreadable. Using `()` solves that. "~" is used instead of "`" for the same reason. So technically we are dealing not with a spec-compliant Jevko, but a trivial variant of it. Maybe I should write a meta-spec which allows one to pick the three special characters before instantiating itself into a spec. Anyway the parser implementation is configurable in that regard, so I simply configure it to use "~()" instead of "`[]".

    > (Also, contrary to your assertion above that this is an example of "leaving [Jevko's data model] as-is", it forgets the order of the name-value pairs as well as I guess all but one of any duplicate set of fields with the same name and also the possibility that there could be both fields and a body.)

    I meant [whitespace] rather than [Jevko's data model].

    Again, queryjevko is a format which uses Jevko as an underlying syntax. It specifies how syntax trees are converted to JS values, by restricting the range of valid Jevkos. It also specifies conversion in the opposite direction, likewise placing restrictions on JS values that can be safely converted to queryjevko.

    The order of name-value pairs happens to get preserved (because of the way JS works), but that's not necessarily relevant. If I were to write a cross-language spec for queryjevko, I'd probably specify that this shouldn't be relied upon.

    Duplicate fields and Jevkos with both fields and a non-whitespace body will produce an error when converting Jevko->JS.

    I hope this clarifies things somewhat.

    Lastly, I'll respond to this for completeness:

    > (By the way, if you want to attribute your JSON example for copyright reasons, you need to attribute it to its author or authors, not to the Wikipedia, which is just the site they posted it on.)

    According to this:

    https://en.wikipedia.org/wiki/Wikipedia:Reusing_Wikipedia_co...

    there are 3 options, one of them being what I did, which is to include a link.

    I think that's all.

    Have a good one!

  • binary-experiments

    Experiments with various binary formats based on Jevko.

    Project mention: Jevko: a minimal general-purpose syntax | news.ycombinator.com | 2022-10-25

    Yes, S-expressions come in many flavors, some more minimal than others, some binary. They are all truly wonderful.

    The most wonderful to me are the simplest ones, and Jevko grows out of the same spirit as them.

    However, it does not attempt to be a new flavor of S-expressions and diverges in ways which to me are worth looking at. I hope it can appeal and be useful not only to minimalist syntax enthusiasts.

    BTW Some time ago I've been also experimenting with binary versions of Jevko, certainly with inspiration from both netstrings and Rivest's csexps:

    https://github.com/jevko/binary-experiments#asttolengthprefi...

    Since then I had some more ideas which I hope to get around to implementing at some point.

  • queryjevko.js

    Functions to convert between complex values and a human-readable format which fits into URL query strings.

    Project mention: Jevko: a minimal general-purpose syntax | news.ycombinator.com | 2022-10-25

    The grammar of S-exps on the other hand, I won't quote here, but I assure you it's much more complicated. How much depends on your flavor (Jevko is also simpler in this regard: there is only one flavor, clearly specified).

    There is no (intended) ambiguity around whitespace in Jevko: whitespace does not occur explicitly in the grammar. Whitespace characters are just characters. This is the defining feature of the syntax.

    For this reason Jevko is more low-level: if you want to treat whitespace in some special way, you have to do that yourself. Although for most use-cases this is very similar and simple, e.g. https://news.ycombinator.com/item?id=33334314

    But the point is that you can also leave it as-is, e.g.: https://github.com/jevko/queryjevko.js

    or do something else -- it's up to your format.

  • InfluxDB

    Access the most powerful time series database as a service. Ingest, store, & analyze all types of time series data in a fully-managed, purpose-built database. Keep data forever with low-cost storage and superior data compression.

NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020). The latest post mention was on 2023-05-19.

JavaScript Syntax related posts

Index

What are some of the best open-source Syntax projects in JavaScript? This list will help you:

Project Stars
1 visual-studio-code 1,006
2 starry-night 842
3 refractor 567
4 lowlight 532
5 metho 215
6 astq 187
7 notepadplusplus 117
8 postcss-less 113
9 tree-sitter-sql 81
10 sugar-high 77
11 remark-highlight.js 65
12 postcss-syntax 38
13 langua 31
14 parsejevko.js 6
15 doku.js 5
16 markup-experiments 1
17 binary-experiments 0
18 queryjevko.js 0
Write Clean JavaScript Code. Always.
Sonar helps you commit clean code every time. With over 300 unique rules to find JavaScript bugs, code smells & vulnerabilities, Sonar finds the issues while you focus on the work.
www.sonarsource.com