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

xanascript

v2.2.8

Published

Programming language with Portuguese syntax, optimizing compiler, built-in ORM, and WebAssembly support

Readme

Installation

npm install -g xanascript

Node.js 18+ required.

Quick Start

PARTIU()

CHAMA ESSE CARA fib(n) {
  SE LIGA SO (n <= 1) { VOLTA n }
  VOLTA fib(n - 1) + fib(n - 2)
}

SOLTA O GRITO("fib(10) =", fib(10))

ACABOU()
xs run hello.xs

Documentation

| Language | Link | |----------|------| | English | Getting Started | | Português | Começando | | Español | Introducción | | LLM Reference | llms.txt |

Features

  • Portuguese syntax — keywords in Portuguese for accessibility
  • Optimizing compiler — generates JavaScript and WebAssembly
  • Built-in ORMCRIA REPOSITORIO for database operations
  • Package managerxs install, xs publish via xanascript.xyz/packages
  • LSP support — IDE integration with diagnostics and autocomplete
  • Bytecode VM — stack-based virtual machine for fast execution
  • Macros — compile-time code generation and transformation
  • Test runner — native test framework (xs test)
  • Source maps — error mapping back to .xs source lines

CLI

xs run <file>         Execute .xs (AST interpreter)
xs vm <file>          Execute .xs (bytecode VM)
xs check <file>       Check syntax
xs fmt <file>         Format code
xs build <file>       Generate JavaScript
xs build --opt <file> Optimized JS with type inference
xs build --wasm <file> WebAssembly output
xs build --standalone Single-file JS with runtime
xs test               Run tests (*test*.xs)
xs dev <file>         Watch mode with hot reload
xs repl               Interactive REPL
xs lsp                Language Server Protocol
xs init [dir]         Create new project
xs install <pkg>      Install package from registry
xs publish            Publish package to registry
xs search <term>      Search packages
xs bench              Run benchmarks
xs docs src/ out/     Generate HTML documentation

Architecture

.xs source → Lexer → Parser → Optimizer → Codegen (JS / Wasm / Bytecode)
                                        ↘ Interpreter (AST walk)

| Module | Purpose | |--------|---------| | lexer.js | Tokenization with line/col tracking | | parser.js | AST generation with error recovery | | optimizer.js | Macros, constant folding, dead code elimination | | interpreter.js | AST-walking interpreter | | runtime.js | Built-in functions and environment | | codegen.js | JavaScript code generation | | codegen_opt.js | Optimized JS (TypedArrays, int32, type inference) | | codegen_wasm.js | WebAssembly text format generation | | wasm_binary.js | Direct Wasm binary generation (no wabt.js) | | bytecode/ | Stack-based bytecode compiler and VM | | pkgmgr.js | Package registry integration | | lsp.js | Language Server Protocol implementation | | testrunner.js | Native test framework | | docsgen.js | HTML documentation generator | | orm.js | Built-in ORM | | macros.js | Compile-time macro expansion | | errors.js | Rust-style error reporting with hints | | sourcemap.js | JS→XS source mapping |

Ecosystem

| Repository | Description | |---|---| | xs | Core language | | xs-site | Website and package registry | | xs-vscode | VS Code extension | | xs-examples | Code examples |

License

Apache-2.0