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

artifactory-cleanup

v0.1.3

Published

Artifactory Cleanup

Readme

artifactory-cleanup

Background

In a development organization dependency management is key to sharing 3rd party and in-house common libraries as well as build artifacts to be deployed to the cloud and in-premise. Artifactory, by JFrog is such as solution that is provided as both a PaaS offering and in house solution for dependency management. The issue with such systems is that after a while, you start to accumulating old artifacts, such as libraries versions not used or outdated binaries that are no longer used. Having these extra artifacts will result in higher monthly cost for the Artifactory PaaS offering as well as slow down your server and make it more difficult for team members to navigate. Out of the box Artifactory will clean up snapshot libraries only. We were looking for a utility that would allow generating a report for artifacts that have not been used in a while. A good solution would be able to run the utility from a CI/CD server. Further, we wanted to let users with the right permissions and credentials to be able to run remotely. Inspired by a JFrog's cleanup plugin for in-premise servers, we decided to create this utility that fits the bill.

Description

artifactory-cleanup allows an Artifactory user with admin permissions to get a list of all artifacts that have not been in user in more than a specified period of time. You could specify a time period such as 6 months or use a specific date. If you run the utility in a dry run, only a report will be generated. Otherwise, the files that fit the criteria will be removed from your artifactory.

How are packages and version determined by by the tool?

The cleanup tool uses two approaches to determine what is the artifact name since Artifactory repository types vary and the parsing by layout is not exposed by the API. First we user a general SemVer 1 parsing regular expression:

/^(?<artifactName>[^\.]+)-(?<artifactVersion>.*?)(?<isSource>-sources)?\.(?<artifactExtension>[a-z\.-]+)?\b$/

If not properly parsed we try to parse it as a nuget package versioning:

/^(?<artifactName>.*?)\.(?<artifactVersion>(\d+\.)+?([\d\w-]+))\.(?<artifactExtension>nupkg)$/

That way we extract:

  • Artifact name
  • Artifact version
  • Extension
  • Sources flag

Prerequisites

You will need to have NPM installed on your machine.

Installation

$ npm install -g artifactory-cleanup

Usage

artifactory-cleanup [options]

Options:
  --help                   Show help                                                                                                        [boolean]
  --version                Show version number                                                                                              [boolean]
  -a, --artifactoryApiUrl  Artifactory server API URL                                                                                      [required]
  -u, --user               Artifactory user with permission to API                                                                         [required]
  -q, --quiet              Quiet down output                                                                                                [boolean]
  -t, --token              Artifactory user generated token                                                                                [required]
  -f, --filter             Repository filter                                                                                     [default: "*-local"]
  -p, --path               Path prefix filter
  -l, --logging            logging level                                              [choices: "error", "warn", "info", "verbose", "debug", "silly"]
  -d, --date               Threshold date (ISO-8610 format)
  -k, --keep               Threshold to keep only nth newest artifact parent folders                                                         [number]
  -o, --duration           Duration of time for threshold. To be combined with `unit` parameter
  -n, --unit               Unit of time for threshold. To be combined with `duration` parameter
     [choices: "years", "y", "quarters", "Q", "months", "M", "weeks", "w", "days", "d", "hours", "h", "minutes", "m", "seconds", "s", "milliseconds",                                                                                                                                              "ms"]
  -r, --dryrun             Dry run of the utility. Not files will be deleted

Example

Example

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details