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

ante-cli

v0.1.7

Published

Manage copyright headers in your source files. Check, fix, and keep them consistent.

Readme

ante

GitHub Stars JSR Version npm Version GitHub Issues License

Manage copyright headers in your source files. Check, fix, and keep them consistent.

What it does

ante adds and maintains copyright headers at the top of your source files. It handles year ranges, contributor lists, license identifiers, and column-aligned formatting. Works as a CLI tool or a library.

//----------------------------------------------------------------------------------------------------
// Copyright (c) 2020-2025               orgrinrt                    [email protected]
//                                       contributor2                [email protected]
// SPDX-License-Identifier: MPL-2.0      https://mozilla.org/MPL/2.0 [email protected]
//----------------------------------------------------------------------------------------------------

The header format is configurable. Column positions, line width, separator characters, and contributor selection strategy are all controlled through your deno.json (or package.json).

Installation

# npm / yarn / pnpm (Node.js 18+)
npm install -g ante-cli
yarn global add ante-cli
pnpm add -g ante-cli

# Deno
deno install -gAf jsr:@hiisi/ante/cli

# Or run directly without installing
deno run -A jsr:@hiisi/ante/cli <command>
npx ante-cli <command>

As a library:

// Deno / JSR
import { generateHeader, loadConfig } from "jsr:@hiisi/ante";

// Node.js
import { generateHeader, loadConfig } from "ante-cli";

Or add to your project:

// deno.json
{
  "imports": {
    "@hiisi/ante": "jsr:@hiisi/ante@^0.1"
  }
}

// package.json
{
  "devDependencies": {
    "ante-cli": "^0.1"
  }
}

CLI Usage

ante init                  # Set up config and install git hooks
ante check                 # Verify headers (exits non-zero if issues found)
ante check "src/**/*.ts"   # Check specific files
ante fix                   # Fix all headers to match config
ante add src/new-file.ts   # Add header to a specific file
ante --help                # Show help

Add to your project scripts:

// deno.json
{
  "tasks": {
    "copyright:check": "deno run -A jsr:@hiisi/ante/cli check",
    "copyright:fix": "deno run -A jsr:@hiisi/ante/cli fix"
  }
}

// package.json
{
  "scripts": {
    "copyright:check": "ante check",
    "copyright:fix": "ante fix"
  }
}

Configuration

Add an ante section to your deno.json or package.json:

{
  "name": "@your/package",
  "version": "1.0.0",
  "license": "MPL-2.0",
  "ante": {
    "width": 100,
    "maintainerEmail": "[email protected]",
    "maxContributors": 3,
    "contributorSelection": "commits",
    "exclude": ["**/generated/**", "**/vendor/**"]
  }
}

Most values have sensible defaults. The license field from your config file is used to derive spdxLicense and licenseUrl automatically.

Configuration Options

| Option | Default | Description | | :--------------------- | :----------------------- | :------------------------------------ | | width | 100 | Total line width for headers | | separatorChar | "-" | Character used for separator lines | | commentPrefix | "//" | Comment prefix (language-aware later) | | nameColumn | 40 | Column position where name starts | | emailColumn | 65 | Column position where email starts | | licenseUrlColumn | 40 | Column for license URL in SPDX line | | maintainerColumn | 75 | Column for maintainer in SPDX line | | spdxLicense | from license | SPDX license identifier | | licenseUrl | derived | URL for the license | | maintainerEmail | from git | Maintainer contact email | | maxContributors | 3 | Max contributors shown in header | | contributorSelection | "commits" | How to pick contributors | | manualContributors | [] | Explicit contributor list | | include | ["**/*.ts", ...] | Files to process | | exclude | ["**/node_modules/**"] | Files to skip |

Contributor Selection Strategies

| Strategy | Description | | :-------- | :----------------------------------------------- | | commits | Contributors with most commits touching the file | | lines | Contributors with most lines changed | | recent | Most recent contributors | | manual | Use manualContributors list |

Library API

import {
  generateHeader,
  hasValidHeader,
  loadConfig,
  parseHeader,
  resolveConfig,
} from "@hiisi/ante"; // or "ante-cli" for Node.js

// Load config from deno.json / package.json
const config = await loadConfig();

// Check if a file has a header
const content = await Deno.readTextFile("src/example.ts");
if (!hasValidHeader(content)) {
  // Generate and prepend a header
  const header = generateHeader(config, contributors, 2025);
  await Deno.writeTextFile("src/example.ts", header + "\n" + content);
}

Git Hooks

The init command installs a pre-commit hook that:

  1. Checks staged .ts files for copyright headers
  2. Creates headers for files that don't have one
  3. Adds the current git user as a contributor if not already present
  4. Updates year ranges when files are modified in a new year
  5. Stages the changes automatically
ante init

This writes hook scripts to .githooks/ and configures git to use them.

Year Handling

  • Single year when file is created and last modified in the same year: 2025
  • Range when modified across years: 2020-2025
  • The end year updates automatically when you modify a file in a new year

Support

Whether you use this project, have learned something from it, or just like it, please consider supporting it by buying me a coffee, so I can dedicate more time on open-source projects like this :)

License

You can check out the full license here

This project is licensed under the terms of the Mozilla Public License 2.0.

SPDX-License-Identifier: MPL-2.0

Runtime Compatibility

| Runtime | Versions Tested | Smoke | Types | Tests | | ----------- | ---------------- | :---: | :---: | :---: | | Deno | 1.x, 2.x | ⚠️ | ⚠️ | ⚠️ | | Node.js | 18, 20, 22 | ✅ | ❌ | ❌ | | Bun | 1.0, 1.1, latest | ✅ | ❌ | ❌ |

  • Smoke: Basic import and function verification
  • Types: TypeScript definitions work correctly
  • Tests: Full unit test suite passes

See COMPATIBILITY.md for detailed version-by-version results.