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

sdp-analyzer

v0.4.7

Published

[![cov](https://narol1024.github.io/sdp-analyzer/badges/coverage.svg)](https://github.com/narol1024/sdp-analyzer/actions) [![npm version](https://img.shields.io/npm/v/sdp-analyzer.svg?style=flat)](https://www.npmjs.com/package/sdp-analyzer) [![npm](https:

Downloads

29

Readme

SDP-Analyzer

cov npm version npm GitHub license

An analyzer to implement the SDP (Stable Dependencies Principle) theory. You can quickly analyze your npm package here: https://narol.pro/sdp-analyzer

Here's just a simple quote, the theory is as follows:

Fan-in = Number of classes outside the component which depends on the component. Fan-out = Number of classes outside the component which the component depends on.

Instability = Fan-out / (Fan-in + Fan-out).

Example: Component A has three classes from component B that depends on it (Fan-in = 3). Component A also depends on two classes from component C (Fan-out = 2). Therefore, the instability value for component A is 2/(3+2) = 2/5.

For more details, please read: My blog.

[!TIP] The analyzing rule above based on the number of dependencies or dependents is a simple evaluation.

I think the rules could be much more exact, such as using more data from GitHub stars or NPM downloads to evaluate again. In that case, it should be called the "Stability Analyzer".

Installation

npm i sdp-analyzer -g

Usages

CLI

To analyze local package

sdp-analyzer analyze ./examples

To analyze NPM package

sdp-analyzer analyze react,vue,svelte,audio-analyser-cli

Npx

npx sdp-analyzer analyze react,vue,svelte,audio-analyser-cli

API Reference

const { analyze } = require("sdp-analyzer");
try {
  const deps = await analyze("react");
} catch (error) {
  //  handle error
}

The results are similar to the following:

[
  {
    "name": "react",
    "in": 195657,
    "out": 1,
    "instability": 0.000005110958918112216,
    "label": "Stable"
  }
]