Skip to content

dephub-js/copyright

Repository files navigation

@dephub/copyright ©

Tiny utility to generate dynamic copyright notice strings based on the build year.

NPM version ESM-only


Features ✨

  • 📅 Automatically detects the current year
  • 🔁 Generates a single year or a year range
  • 🚫 Validates that the build year is not in the future
  • 🧩 Tiny, dependency-free utility
  • 🌳 Tree-shakeable ESM-only package

Installation 📦

  • npm: npm install @dephub/copyright
  • pnpm: pnpm add @dephub/copyright
  • yarn: yarn add @dephub/copyright
  • bun: bun add @dephub/copyright

Usage 🎯

CLI 💻

Not available.

API 🧩

import { copyright } from '@dephub/copyright';

// If current year is 2026
copyright(2020);
// → "Copyright © 2020–2026"

copyright(2026);
// → "Copyright © 2026"

// Throws if build year is in the future
copyright(2030);
// Error: buildYear (2030) cannot be greater than the current year (2026).

License 📄

MIT License – see LICENSE for details.

Author: Estarlin R (estarlincito.com)

About

Tiny utility to generate dynamic copyright notice strings based on the build year.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors