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

@copy-cms/cli

v1.0.19

Published

CLI tool for syncing copy keys to Copy

Readme

@copy/sync

Scan copy keys in je codebase en sync ze naar Copy. Haal copy automatisch op tijdens je build via de Next.js plugin.


Setup

Stap 1: Installeren

pnpm add @copy/cli
pnpm add i18next react-i18next i18next-resources-to-backend

Stap 2: .env.local

CMS_SYNC_API_KEY=eyJ...
NEXT_PUBLIC_CMS_URL=https://copy.example.nl
CMS_OUTPUT_DIR=src/lib/i18n/dictionaries

Zoek je API key? In Copy: Project Settings → Environments → jouw environment → API Key

projectId wordt automatisch uit de API key gehaald — je hoeft hem niet apart op te geven.

CMS_OUTPUT_DIR is optioneel en staat standaard op src/lib/i18n/dictionaries.

Stap 3: Plugin in next.config.ts

import withCopy from '@copy/cli/next';
import type { NextConfig } from 'next';

const nextConfig: NextConfig = {};

// Option A: Expliciet instellen (negeert ENVIRONMENT var)
export default withCopy(nextConfig, {
    syncOnDev: true, // scan & upload keys
    pullOnDev: true, // download copy
});

// Option B: CI/CD-based (via ENVIRONMENT var)
// export default withCopy(nextConfig);
// → ENVIRONMENT=staging pnpm build  → sync + pull
// → ENVIRONMENT=production pnpm build → pull only

Stap 4: i18n provider

import { TranslationProvider } from '@/lib/i18n/provider';

export default function RootLayout({
    children,
}: {
    children: React.ReactNode;
}) {
    return (
        <html>
            <body>
                <TranslationProvider>{children}</TranslationProvider>
            </body>
        </html>
    );
}

Run copy init om alles in één keer te genereren.


Vertalingen gebruiken

Server component

import { getTranslation } from '@/lib/i18n/server';

export default async function Page() {
    const { t } = await getTranslation('common');
    return <h1>{t('common:app.title')}</h1>;
}

Client component

'use client';
import { useTranslation } from '@/lib/i18n/client';

export function MyButton() {
    const { t } = useTranslation('common');
    return <button>{t('common:button.click')}</button>;
}

CLI

copy sync             # scan keys en upload naar Copy
copy sync --dry-run   # toon wat zou veranderen zonder te uploaden
copy pull             # download gepubliceerde copy
copy pull --env staging
copy pull --output ./translations
copy status           # diff vs laatste sync (geen netwerk)
copy init             # eenmalige setup wizard

Programmatic API

import { syncTranslations, pullTranslations } from '@copy/cli/api';

await syncTranslations({ projectRoot: '.', verbose: true });

await pullTranslations({ outputDir: 'src/lib/i18n/dictionaries' });

Logs

Sync:

[CMS] ✓ Synced: 3 key(s) added, 12 translation(s) added, 2 pruned, 8 skipped

Pull:

[CMS] ✓ Pulled translations: 4 file(s)
  en/common.json — 42 key(s)
  en/auth.json — 8 key(s)
  nl/common.json — 42 key(s), 3 new
  nl/auth.json — 8 key(s)

Workflow

Developers (lokaal):

  1. Voeg t('namespace:key') toe in code
  2. Run copy pull om de laatste copy op te halen
  3. Push naar develop

CI/CD Staging:

  1. ENVIRONMENT=staging pnpm build
  2. Plugin: sync keys → pull copy van staging

CI/CD Production:

  1. ENVIRONMENT=production pnpm build
  2. Plugin: pull copy van gepubliceerde release

Troubleshooting

| Probleem | Oplossing | | -------------------- | -------------------------------------------------------------------------------- | | Geen keys gevonden | Gebruik t('namespace:key') — namespace is verplicht | | Plugin doet niks | Controleer dat CMS_SYNC_API_KEY en NEXT_PUBLIC_CMS_URL in .env.local staan | | API key niet herkend | Herstart dev server na wijzigen van .env.local | | Pull mislukt | Controleer API key in Copy Project Settings | | Oude copy | copy pull --force om cache te omzeilen |