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

@xano/xanoscript-language-server

v11.2.0

Published

Language Server Protocol implementation for XanoScript

Downloads

656

Readme

██╗  ██╗███████╗    ██╗      █████╗ ███╗   ██╗ ██████╗ ██╗   ██╗ █████╗  ██████╗ ███████╗
╚██╗██╔╝██╔════╝    ██║     ██╔══██╗████╗  ██║██╔════╝ ██║   ██║██╔══██╗██╔════╝ ██╔════╝
 ╚███╔╝ ███████╗    ██║     ███████║██╔██╗ ██║██║  ███╗██║   ██║███████║██║  ███╗█████╗
 ██╔██╗ ╚════██║    ██║     ██╔══██║██║╚██╗██║██║   ██║██║   ██║██╔══██║██║   ██║██╔══╝
██╔╝ ██╗███████║    ███████╗██║  ██║██║ ╚████║╚██████╔╝╚██████╔╝██║  ██║╚██████╔╝███████╗
╚═╝  ╚═╝╚══════╝    ╚══════╝╚═╝  ╚═╝╚═╝  ╚═══╝ ╚═════╝  ╚═════╝ ╚═╝  ╚═╝ ╚═════╝ ╚══════╝

███████╗███████╗██████╗ ██╗   ██╗███████╗██████╗
██╔════╝██╔════╝██╔══██╗██║   ██║██╔════╝██╔══██╗
███████╗█████╗  ██████╔╝██║   ██║█████╗  ██████╔╝
╚════██║██╔══╝  ██╔══██╗╚██╗ ██╔╝██╔══╝  ██╔══██╗
███████║███████╗██║  ██║ ╚████╔╝ ███████╗██║  ██║
╚══════╝╚══════╝╚═╝  ╚═╝  ╚═══╝  ╚══════╝╚═╝  ╚═╝

XanoScript Language Server

A Language Server Protocol (LSP) implementation for XanoScript, built on Chevrotain.

Maintained by the Xano team.

Installation

npm install @xano/xanoscript-language-server

Requirements: Node.js 20+

Features

The language server provides full LSP support including:

  • Code Completion - Context-aware suggestions triggered by ., :, $, and |
  • Syntax Highlighting - Semantic token-based highlighting for XanoScript constructs
  • Hover Information - Documentation and type information on hover
  • Diagnostics - Real-time error detection and reporting

Supported Object Types

The parser supports the following XanoScript constructs:

| Type | Description | |------|-------------| | query | API endpoints with HTTP verbs, input validation, and responses | | function | Reusable logic blocks with testing capabilities | | task | Scheduled operations with cron-like triggers | | api_group | Collections of related API endpoints | | table | Database schema definitions with column types | | table_trigger | Database table trigger definitions | | workflow_test | Test definitions for workflows | | addon | Add-on definitions | | agent | AI agent definitions | | agent_trigger | Agent trigger handlers | | branch | Branch logic | | mcp_server | MCP server definitions | | mcp_server_trigger | MCP server trigger handlers | | middleware | Middleware definitions | | realtime_channel | Realtime channel definitions | | realtime_trigger | Realtime trigger handlers | | tool | Tool definitions | | workspace | Workspace definitions | | workspace_trigger | Workspace trigger handlers |

Built-in Function Domains

XanoScript includes functions organized by domain:

  • ai - AI and machine learning operations
  • api - External API calls and HTTP requests
  • array - Array manipulation and iteration
  • cloud - Cloud service integrations
  • controls - Flow control (conditionals, loops, etc.)
  • db - Database queries and operations
  • debug - Debugging and logging utilities
  • expect - Testing assertions
  • math - Mathematical operations
  • object - Object manipulation
  • redis - Redis cache operations
  • schema - Schema operations
  • security - Authentication and security functions
  • storage - File storage operations
  • stream - Streaming data operations
  • text - String manipulation
  • util - General utilities
  • var - Variable operations
  • zip - Compression utilities

Project Structure

├── server.js              # LSP server entry point
├── lexer/                 # Lexical analysis
│   ├── lexer.js           # Chevrotain lexer implementation
│   ├── tokens.js          # Main token registry
│   └── [domain].js        # Domain-specific tokens (api, db, cloud, etc.)
├── parser/                # Syntax parsing
│   ├── base_parser.js     # Core XanoBaseParser
│   ├── [type]_parser.js   # Object type parsers
│   ├── attributes/        # Field attributes (description, disabled, sensitive)
│   ├── clauses/           # Language blocks (stack, input, response, etc.)
│   ├── definitions/       # Type and column definitions
│   ├── functions/         # Built-in functions by domain
│   └── generic/           # Reusable parsing components
├── onCompletion/          # Code completion logic
├── onDidChangeContent/    # Diagnostics and error reporting
├── onHover/               # Hover documentation
└── onSemanticCheck/       # Semantic token highlighting

Development

# Install dependencies
npm install

# Run all tests (~1800 tests)
npm test

# Run specific test
npm test -- -g "test name"

# Lint code
npm run lint

# Fix lint issues
npm run lint:fix

# Generate TextMate language definition
npm run tm

Adding New Features

New Object Type

  1. Create a new parser in parser/ (e.g., my_object_parser.js)
  2. Follow existing parser patterns (see query_parser.js, function_parser.js)
  3. Register it in server.js

New Keyword/Function

We have a hierarchy for the different statements XanoScript uses:

  1. Parser - Top level (Query parser, Function parser, etc.)
  2. Clause - Main blocks in a given object type (stack, response, input, etc.)
  3. Functions - Statements like debug.log or db.query
  4. Attributes/Definitions - Components used to define functions
  5. Generic - Shared language toolset

To add a new function:

  1. Add token definition in appropriate lexer/ file
  2. Create function implementation in parser/functions/[domain]/
  3. Register in parent clause or parser
  4. Add comprehensive tests in corresponding .spec.js file

Testing

The language server is heavily tested and should remain that way. Tests should be:

  • Easy to copy, paste, and extend
  • Straightforward and easy to read
  • Avoid dynamic generation (no loops)

Test files use .spec.js naming convention and mirror the source structure.

CI/CD

On commit, pre-commit hooks run linting via Husky. The CI pipeline runs all tests and linting checks. Configuration is in .github/workflows/ci.yml.

License

MIT License - see LICENSE for details.