All Projects → geut → jsdast

geut / jsdast

Licence: MIT License
JSDoc Abstract Syntax Tree

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to jsdast

Compodoc
📔 The missing documentation tool for your Angular, Nest & Stencil application
Stars: ✭ 3,567 (+17735%)
Mutual labels:  jsdoc, ast
ts-lehre
Generate document block(JsDoc, EsDoc, TsDoc) from source code
Stars: ✭ 14 (-30%)
Mutual labels:  jsdoc, tsdoc
MarkdownSyntax
☄️ A Type-safe Markdown parser in Swift.
Stars: ✭ 65 (+225%)
Mutual labels:  ast, unist
Unified
☔️ interface for parsing, inspecting, transforming, and serializing content through syntax trees
Stars: ✭ 3,036 (+15080%)
Mutual labels:  ast, unist
Esdoc
ESDoc - Good Documentation for JavaScript
Stars: ✭ 2,706 (+13430%)
Mutual labels:  jsdoc, ast
sast
Parse CSS, Sass, SCSS, and Less into a unist syntax tree
Stars: ✭ 51 (+155%)
Mutual labels:  ast, unist
xast
Extensible Abstract Syntax Tree
Stars: ✭ 32 (+60%)
Mutual labels:  ast, unist
parse-function
(!! moved to tunnckoCore/opensource multi-package repository !!) 🔱 Parse a function into an object using espree, acorn or babylon parsers. Extensible through Smart Plugins.
Stars: ✭ 37 (+85%)
Mutual labels:  ast
vast
A simple tool for vlang, generate v source file to AST json file
Stars: ✭ 23 (+15%)
Mutual labels:  ast
impast
A library for package AST importing
Stars: ✭ 26 (+30%)
Mutual labels:  ast
hxjsonast
Parse JSON into position-aware AST with Haxe!
Stars: ✭ 28 (+40%)
Mutual labels:  ast
yode
Yode - Focused Code Editing
Stars: ✭ 28 (+40%)
Mutual labels:  ast
hast-util-to-html
utility to serialize hast to HTML
Stars: ✭ 47 (+135%)
Mutual labels:  unist
ast-builder
Build your ASTs directly from code
Stars: ✭ 18 (-10%)
Mutual labels:  ast
generator-vintage-frontend
Modern front-end workflow
Stars: ✭ 15 (-25%)
Mutual labels:  jsdoc
tsquery-playground
Playground for TSQuery
Stars: ✭ 30 (+50%)
Mutual labels:  ast
astra
Astra: a Java tool for analysing and refactoring Java source code
Stars: ✭ 35 (+75%)
Mutual labels:  ast
gogrep
Syntax-aware Go code search, based on the mvdan/gogrep
Stars: ✭ 25 (+25%)
Mutual labels:  ast
tidy-jsdoc
A clean JSDoc3 template
Stars: ✭ 16 (-20%)
Mutual labels:  jsdoc
esvalid
confirm that a SpiderMonkey format AST represents an ECMAScript program
Stars: ✭ 24 (+20%)
Mutual labels:  ast

jsdast

Syntax tree JSDoc based on Unist spec

Build Status JavaScript Style Guide standard-readme compliant

Made by GEUT

Install

$ npm install @geut/jsdast

Usage

const unified = require('unified')
const { parser } = require('@geut/jsdast')

const tree = unified().use(parser).parse(`
  /**
   * @param {number} a
   * @param {number} b
   * @returns {number}
   */
  function sum(a, b) {
    return a + b
  }
`)

console.log(JSON.stringify(tree, null, 2))

/*
{
  "type": "Root",
  "children": [
    {
      "type": "Module",
      "name": "Index",
      "doc": {
        "description": "",
        "tags": []
      },
      "children": [
        {
          "type": "FunctionDeclaration",
          "name": "sum",
          "doc": {
            "tags": [
              {
                "tagName": "returns",
                "fullText": "@returns {number}",
                "typeExpression": "number"
              }
            ]
          },
          "isExported": false,
          "isDefaultExport": false,
          "valueType": "number",
          "isGenerator": false,
          "isAsync": false,
          "children": [
            {
              "type": "Parameter",
              "name": "a",
              "doc": {
                "tags": []
              },
              "isRestParameter": false,
              "valueType": "number",
              "isOptional": false
            },
            {
              "type": "Parameter",
              "name": "b",
              "doc": {
                "tags": []
              },
              "isRestParameter": false,
              "valueType": "number",
              "isOptional": false
            }
          ]
        }
      ]
    }
  ]
}
*/

Issues

🐛 If you found an issue we encourage you to report it on github. Please specify your OS and the actions to reproduce it.

Contributing

👥 Ideas and contributions to the project are welcome. You must follow this guideline.

License

MIT © A GEUT project

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].