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

@pyyupsk/copyright

v0.0.1

Published

A framework-agnostic TypeScript library for displaying copyright notices with auto year calculation, preset formats, custom templates, and React support

Readme

@pyyupsk/copyright

CI License: MIT npm

A framework-agnostic TypeScript library for displaying copyright notices with auto year calculation, preset formats, custom templates, and React support.

Features

  • Auto year calculation with year ranges
  • 4 preset formats (minimal, standard, full, legal)
  • Custom template support with variable substitution
  • HTML output with styling (className, style, tag)
  • React component with declarative props API
  • Direct DOM rendering via selector or Element reference
  • Zero runtime dependencies for core library
  • Dual ESM/CJS output
  • Full TypeScript support

Installation

npm install @pyyupsk/copyright
# or
bun add @pyyupsk/copyright

Quick Start

Basic Usage

import { Copyright } from "@pyyupsk/copyright";

const copyright = new Copyright({ owner: "ACME Corp" });
console.log(copyright.getText()); // © 2026 ACME Corp

Year Range

const copyright = new Copyright({
  owner: "ACME Corp",
  startYear: 2020,
});
console.log(copyright.getText()); // © 2020-2026 ACME Corp

Preset Formats

const copyright = new Copyright({
  owner: "ACME Corp",
  format: "standard",
});
console.log(copyright.getText()); // Copyright © 2026 ACME Corp

// Available formats: minimal, standard, full, legal

Custom Template

const copyright = new Copyright({
  owner: "ACME Corp",
  template: "Made by {owner} in {year}",
});
console.log(copyright.getText()); // Made by ACME Corp in 2026

// Available variables: {symbol}, {year}, {owner}, {startYear}, {endYear}

HTML Output

const copyright = new Copyright({ owner: "ACME Corp" });

// Default span
console.log(copyright.toHTML());
// <span>© 2026 ACME Corp</span>

// With options
console.log(
  copyright.toHTML({
    tag: "footer",
    className: "copyright-text",
    style: { color: "gray" },
  }),
);
// <footer class="copyright-text" style="color: gray">© 2026 ACME Corp</footer>

DOM Rendering

const copyright = new Copyright({ owner: "ACME Corp" });

// Render to selector
copyright.render("#footer");

// Render to Element
const container = document.getElementById("footer");
copyright.render(container, { tag: "small", className: "text-muted" });

React Component

import { Copyright } from "@pyyupsk/copyright/react";

function Footer() {
  return (
    <Copyright
      owner="ACME Corp"
      startYear={2020}
      format="standard"
      as="footer"
      className="text-gray-500"
    />
  );
}

API Reference

Copyright Class

Constructor

new Copyright(options: CopyrightOptions);

Options

| Option | Type | Default | Description | | ----------- | ---------------------------------------------- | ----------- | --------------------------- | | owner | string | (required) | Copyright owner name | | startYear | number | current | Start year for range | | endYear | number \| "auto" | "auto" | End year (auto = current) | | format | "minimal" \| "standard" \| "full" \| "legal" | "minimal" | Preset format | | template | string | - | Custom template (overrides) |

Methods

  • getText() - Returns plain text copyright string
  • toHTML(options?) - Returns HTML string with optional tag, className, style
  • render(target, options?) - Renders to DOM element (selector or Element)
  • setOptions(options) - Updates options (chainable)
  • static create(options) - Factory method

React <Copyright /> Component

All CopyrightOptions plus:

| Prop | Type | Default | Description | | ----------- | -------- | -------- | -------------- | | as | string | "span" | Element type | | tag | string | "span" | Alias for as | | className | string | - | CSS class | | style | object | - | Inline styles |

License

MIT