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 🙏

© 2025 – Pkg Stats / Ryan Hefner

fauna-schema-tools

v0.0.22

Published

A set of tools for working with FaunaDB schema definitions.

Readme

fauna-schema-tools

A set of tools for working with FaunaDB schema definitions.

Commands

link

Merge schema files and link functions. See Function Linking for more information.

fauna-schema-tools link
> Merge schema files and link functions

ARGUMENTS:
  <schema path>     - Path to schema files (globs are supported)
  [...schema paths] - Additional paths to schema files

FLAGS:
  --watch, -w - Watch for changes and rebuild
  --push, -p  - Push schema to db
  --help, -h  - show help

OPTIONS:
  --types-out, -t <str>  - Output path for ts types file [optional]
  --names-out, -n <str>  - Output path for ts function names map file [optional]
  --schema-out, -s <str> - Output path for combined fsl file [optional]
  --key, -k <str>        - Fauna key [optional]
  --endpoint, -e <str>   - Fauna endpoint (defaults to https://db.fauna.com if key is set, otherwise https://localhost:8443) [optional]
  --retain, -r <number>  - Number of function revisions to retain [optional]

format

Format schema files.

> Format a schema file

ARGUMENTS:
  [...schema paths] - Paths to schema files (globs are supported)

FLAGS:
  --write, -w - Write changes to file
  --help, -h  - show help

Library

When importing the library, the wasm module must be initialized. Depending on your environment, you may need to use different methods to load the wasm file:

import { init } from "fauna-schema-tools";
import wasm from "fauna-schema-tools/wasm-embedded";

init(wasm);

// or use a dynamic import
init((await import("fauna-schema-tools/wasm-embedded")).default);

// or even read the wasm file directly!
init(
  await fs.readFile(
    typeof require !== "undefined"
      ? require.resolve("fauna-schema-tools/wasm")
      : import.meta.resolve("fauna-schema-tools/wasm"),
  ),
);

// or somehow preload the module
declare const module: WebAssembly.Module;
init(module);

Function Linking

Function linking allows you to have atomic function names that won't change the behavior of your live application when you update your schema.

This is done by generating a hash based on the function's body and including it in the function's name. All references in the schema to the function are updated to use the new name.

When combined with the --retain option, you can safely push schema changes to your database without affecting your live application.

When calling a function from a query in your application, use the --names-out option to generate a module that exports the names of the functions. Then it can be used like this:

import { fql } from "fauna";
import { myFunction } from "./functions_gen";

fql`${myFunction}()`;