npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@vasp-framework/parser

v1.5.0

Published

Lexer, parser, and semantic validator for the .vasp DSL

Downloads

1,787

Readme

@vasp-framework/parser

Lexer, recursive descent parser, and semantic validator for the .vasp DSL.

Version: 1.5.0

This is an internal package used by vasp-cli and @vasp-framework/generator. You don't need to install it unless you're building custom Vasp tooling.

Usage

import { parse } from '@vasp-framework/parser'

const ast = parse(`
  app MyApp {
    title: "My App"
    db: Drizzle
    ssr: false
    typescript: false
  }

  route HomeRoute {
    path: "/"
    to: HomePage
  }

  page HomePage {
    component: import Home from "@src/pages/Home.vue"
  }
`)

console.log(ast.app.name)    // 'MyApp'
console.log(ast.routes[0])   // { type: 'Route', name: 'HomeRoute', path: '/', to: 'HomePage', ... }

API

parse(source: string, filename?: string): VaspAST

Tokenizes, parses, and semantically validates a .vasp source string. Throws ParseError on any error.

import { parse } from '@vasp-framework/parser'
import { ParseError } from '@vasp-framework/core'

try {
  const ast = parse(source, 'main.vasp')
} catch (err) {
  if (err instanceof ParseError) {
    console.error(err.message)   // '[E010_UNEXPECTED_TOKEN] (line 3, col 5): ...'
    console.log(err.diagnostics) // structured list of errors with codes, messages, locations
  }
}

Error Codes

| Code | Description | |---|---| | E001_UNCLOSED_BLOCK_COMMENT | Block comment /* ... */ was never closed | | E002_INVALID_CHARACTER | Unexpected character in source | | E003_UNTERMINATED_STRING | String literal missing closing quote | | E010_UNEXPECTED_TOKEN | Parser got a token it didn't expect | | E011_DUPLICATE_BLOCK | Block name already defined | | E038_INVALID_ENV_REQUIREMENT | Invalid app.env requirement (must be required or optional) | | E039_DUPLICATE_ENV_KEY | Duplicate key inside app.env | | E100_MISSING_APP_BLOCK | No app block found | | E101_UNKNOWN_PAGE_REF | Route to references undefined page | | E102_EMPTY_CRUD_OPERATIONS | CRUD operations array is empty | | E103_UNKNOWN_CRUD_OPERATION | Unknown CRUD operation | | E104_REALTIME_ENTITY_NOT_CRUD | Realtime entity has no matching CRUD block | | E105_UNKNOWN_REALTIME_EVENT | Unknown realtime event | | E106_EMPTY_AUTH_METHODS | Auth methods array is empty | | E107_UNKNOWN_AUTH_METHOD | Unknown auth method | | E108_UNKNOWN_ENTITY_REF | Query references unknown entity | | E109_UNKNOWN_ENTITY_REF | Action references unknown entity | | E110_UNKNOWN_JOB_EXECUTOR | Unknown job executor | | E111_CRUD_ENTITY_NOT_DECLARED | CRUD entity has no matching entity block | | E112_DUPLICATE_ENTITY | Duplicate entity name | | E113_DUPLICATE_ROUTE_PATH | Duplicate route path | | E114_INVALID_FIELD_TYPE | Unsupported primitive field type | | E115_UNDEFINED_RELATION_ENTITY | Relation field references unknown entity | | E116_UNKNOWN_API_METHOD | API block uses unsupported HTTP method | | E117_DUPLICATE_API_ENDPOINT | Duplicate API method+path combination | | E118_ROLES_WITHOUT_AUTH_CONFIG | Roles used without auth.roles declaration | | E119_ROLES_REQUIRE_AUTH | Roles used while auth: false | | E120_UNKNOWN_ROLE_REF | Query/action/api references unknown role | | E121_UNKNOWN_MIDDLEWARE_SCOPE | Unsupported middleware scope | | E122_INVALID_ENV_KEY | app.env key is not uppercase snake case |

License

Apache 2.0