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

@datrix/cli

v0.2.0

Published

Command-line tools for Datrix framework

Readme

@datrix/cli

Command-line interface for the Datrix database management framework. Provides tools for running migrations, generating TypeScript types, and exporting/importing data.

Installation

npm install -D @datrix/cli

Usage

datrix <command> [options]

Commands

migrate

Runs pending database migrations based on your current schema definitions.

datrix migrate
datrix migrate --dry-run   # Preview what would be applied without executing
datrix migrate --status    # Show current migration status

| Option | Description | |---|---| | --dry-run | Show what would be done without applying changes | | --status | Display pending and applied migrations |


generate schema <Name>

Generates a schema template file for a new model.

datrix generate schema User
datrix generate schema Post --output ./src/schemas

| Option | Description | |---|---| | --output <path> | Custom output directory (default: current directory) |


generate types

Generates TypeScript type definitions from your registered schemas.

datrix generate types
datrix generate types --output ./src/types/datrix.ts

| Option | Description | |---|---| | --output <path> | Output file path (default: ./types/datrix.ts) |


export

Exports all database data to a zip file.

datrix export
datrix export --output ./backups/backup.zip
datrix export --include-files
datrix export --include-files --pack-files
datrix export --resume ./export_2024-01-01   # Resume an interrupted file export

| Option | Description | |---|---| | --output <path> | Output file path (default: ./export_<timestamp>.zip) | | --include-files | Also export media files (requires @datrix/api-upload plugin) | | --pack-files [bytes] | Pack downloaded files into zip chunks (default chunk size: 1GB) | | --resume <dir> | Resume an interrupted file export from a previous run |


import <file.zip>

Imports data from a previously exported zip file. This drops all existing data.

datrix import ./backup.zip
datrix import ./backup.zip --agree           # Skip confirmation prompt
datrix import ./export_dir --with-files      # Import data + media files
datrix import ./export_dir --only-files      # Import media files only
datrix import ./export_dir --resume <dir>    # Resume an interrupted file import

| Option | Description | |---|---| | --agree | Skip the "drop all data" confirmation prompt | | --with-files | Import database and media files from an export directory | | --only-files | Import media files only, skip database import | | --resume <dir> | Resume an interrupted file import |


Global Options

| Option | Description | |---|---| | --config <path> | Config file path (default: ./datrix.config.ts) | | --verbose | Enable verbose output | | --help | Show help message |

Configuration

The CLI looks for a datrix.config.ts file in the current directory by default.

import { defineConfig } from "@datrix/core";
import { createPostgresAdapter } from "@datrix/adapter-postgres";

export default defineConfig({
  adapter: createPostgresAdapter({
    connectionString: process.env.DATABASE_URL,
  }),
  schemas: [UserSchema, PostSchema],
});

License

MIT