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

providence-analytics

v0.17.3

Published

Providence is the 'All Seeing Eye' that measures effectivity and popularity of software. Release management will become highly efficient due to an accurate impact analysis of (breaking) changes

Downloads

190

Readme

Node Tools >> Providence Analytics >> Overview ||10

import { html } from '@mdjs/mdjs-preview';

Providence is the 'All Seeing Eye' that generates usage statistics by analyzing code. It measures the effectivity and popularity of your software. With just a few commands you can measure the impact for (breaking) changes, making your release process more stable and predictable.

For instance for a repo "lion-based-ui" that extends @lion/* we can answer questions like:

  • Which subsets of my product are popular? Which exports of reference project @lion/form-core are consumed by target project "lion-based-ui"?

  • How do sub classers consume/override my product? Which classes / webcomponents inside target project "lion-based-ui" extend from reference project @lion/\*? Which of the methods within those classes are overridden?

  • etc...

Providence uses abstract syntax trees (ASTs) to have the most advanced analysis possible. It does this via the oxc parser, the quickest parser available today!

Run

Providence expects an analyzer name that tells it what type of analysis to run:

npx providence analyze <analyzer-name>

By default Providence ships these analyzers:

  • find-imports
  • find-exports
  • find-classes
  • match-imports
  • match-subclasses

Let's say we run find-imports:

npx providence analyze find-imports

Now it retrieves all relevant data about es module imports. There are plenty of edge cases that it needs to take into account here; you can have a look at the tests to get an idea about all different cases Providence handles for you.

Projects

Providence uses the concept of projects. A project is a piece of software to analyze: usually an npm artifact or a git (mono-)repository. What all projects have in common, is a package.json. From it, the following project data is derived:

  • the name
  • the version
  • the files it uses for scanning. One of the following strategies is usually followed:
    • exportmap entrypoints (by 'expanding' package.json "exports" on file system)
    • npm files (it reads package.json "files" | .npmignore)
    • the git files (it reads .gitignore)
    • a custom defined list

For a "find" analyzer, there is one project involved (the target project).

We can specify it like this (we override the default current working directory):

npx providence analyze find-imports -t /importing/project

For a "match" analyzer, there is also a reference project. Here we match the exports of the reference project (-r) against the imports of the target project (-t).

npx providence analyze match-imports -t /importing/project -r /exporting/project

Utils

Providence comes with many tools for deep traversal of identifiers, the (babel like) traversal of ast trees in oxc and swc and more. Also more generic utils for caching and performant globbing come delivered with Providence.

For a better understanding, check out the utils folders (tests and code).

More

For more options, see:

npx providence --help