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

@univ-lehavre/atlas-cli-toolkit

v1.0.0

Published

Framework-agnostic CLI boilerplate for the atlas monorepo: env reading, argv flag parsing and fatal-error/exit-code handling.

Readme

@univ-lehavre/atlas-cli-toolkit

Boilerplate partagé, agnostique du framework, pour les CLIs du monorepo atlas.

Le périmètre est volontairement étroit et sans politique d'I/O : lecture d'environnement, parsing de flags argv et gestion erreur fatale / code de sortie. Le rendu terminal (@clack/prompts, couleurs) et les frameworks d'arguments (yargs) restent dans chaque CLI : ils ne peuvent pas vivre dans packages/ (cf. audit de structure du workspace).

Utilisation

Lecture d'environnement

import { getEnv, requireEnv } from '@univ-lehavre/atlas-cli-toolkit';

const userAgent = getEnv('OPENALEX_USER_AGENT', 'atlas/1.0.0');

const env = requireEnv(['REDCAP_API_URL', 'REDCAP_API_TOKEN']);
if (!env.ok) {
  log.error(`Missing required environment variables: ${env.missing.join(', ')}`);
  process.exit(1);
}
const { REDCAP_API_URL, REDCAP_API_TOKEN } = env.values;

Parsing de flags

import { hasFlag, getFlagValue, findUnknownFlags } from '@univ-lehavre/atlas-cli-toolkit';

const args = process.argv.slice(3);
const batch = hasFlag(args, '--batch', '--yes');
const threshold = getFlagValue(args, '--threshold');
const unknown = findUnknownFlags(args, {
  booleanFlags: ['--batch', '--yes'],
  valueFlags: ['--threshold'],
});
if (unknown.length > 0) {
  log.error(`Unknown option(s): ${unknown.join(', ')}`);
  process.exit(1);
}

Erreur fatale / code de sortie

#!/usr/bin/env node
import { runMain } from '@univ-lehavre/atlas-cli-toolkit';
import { main } from '../commands/index.js';

runMain(main); // main() rejette → "Fatal error:" + process.exit(1)

API

  • getEnv(name, fallback?) — lit une variable d'environnement (vide ⇒ fallback).
  • requireEnv(names){ ok: true, values } ou { ok: false, missing }.
  • hasFlag(args, ...names) — présence d'un flag booléen (ou de l'un de ses alias).
  • getFlagValue(args, name) — valeur suivant un flag (--threshold 0.3"0.3").
  • findUnknownFlags(args, { booleanFlags, valueFlags }) — flags non reconnus.
  • runMain(main, { exitCode?, onError? }) — exécute un main async, reporte et sort.
  • clearScreen() — réinitialise l'écran du terminal (séquence ANSI ESC c).