1.0.4 • Published 1 year ago

@fullstackcraftllc/codevideo-dynamic-ast v1.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

codevideo-dynamic-ast

Parse and validate code from multiple programming languages using their native AST parsers - all through a single unified interface.

Installation

npm install codevideo-dynamic-ast

Usage

Provide an array of one or more IFileSource objects and get back an IParseResult back.

import { parseProject } from '@fullstackcraftllc/codevideo-dynamic-ast';

const files = [
    { path: 'src/index.ts', content: '...' },
    { path: 'src/utils/someutil.ts', content: '...' },
    { path: 'src/components/MyComponent.tsx', content: '...' }
];

const results = await parseProject(files);
console.log(results);

// Output:
// {
//     "projects": [
//         {
//             "language": "TypeScript"
//             "errors": [...]
//         },
//     ]
// }

Supported Languages

  • TypeScript (using ts-morph)
  • C# (using dotnet CLI)
  • Go (using go CLI)

Requirements

  • Node.js >= 16
  • TypeScript >= 4.0.0
  • For C# parsing: .NET SDK
  • For Go parsing: Go toolchain

Development

Install dependencies:

npm install

Build:

npm run build

Test:

npm test
1.0.4

1 year ago

1.0.3

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago