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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@boyeborg/crown

v1.0.8

Published

Ensures the youngest (newest) monarch (version) within kingdoms (packages) holds the royal office (is taggeed as latest).

Downloads

12

Readme

crown

This library considers the npm package registry as a world of aristocracies

The full honorary title of react version 16.10.2: "16.10 the Second, by the Grace of God of React, Defender of the Faith"

npm as an aristocracy

Each package is regarded as a kingdom, and its dependencies are its neighboring kingdoms. Each kingdom (if it's a proper aristocracy) has one or more monarchs (the versions of the package). The reigning monarch (the version tagged with latest), is known as the Queen. Each kingdom (package) must have exactly one queen (latest version) at any given point. Opposed to the usual aristocracy systems, the youngest (newest) monarch (version) should always rule (be tagged as latest).

What do I need this library for?

Not all queens gives the throne away when a younger monarch comes along. Hence, a system to regularly inspect the queen of a kingdom and abdicates her if she's not the youngest monarch of the kingdom is useful. This library does just that. It inspect one or more kingdoms and their neighboring kingsoms (recursivly). If a kingdom has a monarch younger than the queen, the queen is abdicated and the younger monarch is crowned. If for some reason the kingdom does not have a queen (no latest tag), the youngest monarch is immidiety crowned to recover from the aristocratic collapse. Also, if the queen is deceased (the version tagged as latest does not exist), the youngest monarch is also immidietly crowned.

Install

Install with npm:

npm install --global @boyeborg/crown

Usage

$ crown --help

  Ensures the youngest (newest) monarch (version) within kingdoms (packages)
  holds the royal office (is taggeed as latest).

  Usage
    $ crown [<kingdom>...] [options]

  Options
    --verbose   Indulge in verbosity.
    --dry-run   Run without updating.
    --no-info   Hide info output.
    --no-warn   Hide warnings.
    --no-error  Hide errors.
    --help      Display this text.
    --version   Display the version.

  Configuration
    crown adheres to the the .npmrc file within your home directory.

  Terminology
    Imagine the npm package registry as a world of aristocracies.
    Each package is regarded as a kingdom, and its dependencies are its
    neighboring kingdoms. Each kingdom (if it's a proper aristocracy) has one
    or more monarchs (the versions of the package). The reigning monarch (the
    version tagged with latest), is known as the Queen. Each kingdom (package)
    must have exactly one queen (latest version) at any given point. Opposed to
    the usual aristocracy systems, the youngest (newest) monarch (version)
    should always rule (be tagged as latest).

  Why do I need this?
    Not all queens gives the throne away when a younger monarch comes along.
    Hence, a system to regularly inspect the queen of a kingdom and abdicates
    her if she's not the youngest monarch of the kingdom is useful. This
    library does just that. It inspect one or more kingdoms and their
    neighboring kingsoms (recursivly). If a kingdom has a monarch younger than
    the queen, the queen is abdicated and the younger monarch is crowned. If
    for some reason the kingdom does not have a queen (no latest tag), the
    youngest monarch is immidiety crowned to recover from the aristocratic
    collapse. Also, if the queen is deceased (the version tagged as latest does
    not exist), the youngest monarch is also immidietly crowned.

You can also use crown as a module like so:

const crown = require("@boyeborg/crown");

const npmConfig = {
  token: "secret"
  /* other npm config, see https://github.com/npm/npm-registry-fetch */
};
const logger = {
  verbose: msg => {
    /* Handle verbose messages */
  },
  info: msg => {
    /* Handle info messages */
  },
  warn: msg => {
    /* Handle warnings */
  },
  error: msg => {
    /* Handle errors */
  }
};

crown("react", npmConfig, { logger, dryRun: false }).then(() =>
  console.log("done!")
);