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

@quinscape/mvndep-to-dot

v0.0.3

Published

Converts maven JSON dependency data into an abridged DOT output

Downloads

23

Readme

mvndeps-to-dot

Converts maven JSON dependency data into an abridged DOT output

Getting JSON data from maven

You can direct the dependency plugin to output its dependency tree data as JSON.

mvn org.apache.maven.plugins:maven-dependency-plugin:3.8.1:tree -DoutputType=json -DoutputFile=dependency.json

There seems to be a bug in older versions of that plugin which ignore the outputType option and write the text format instead. That's why it seems safer to use the fully qualified invocation.

After running above command you should have one or more dependency.json files. If you have sub modules the plugin will produce one dependency.json per module.

Running @quinscape/mvndeps-to-dot

Now we just need to feed all those dependency.json into our script

npx @quinscape/mvndeps-to-dot dependency.json

You either give the location of the JSON files via command line or you can use the --inputs option to read it from a file.

npx @quinscape/mvndeps-to-dot -i json-files.txt

Buckets

Note that while the tool already simplifies the DOT output by only considering direct dependencies, it is still rather useless without bucket definitions. Buckets merge multiple artifacts into one logical node in the graph.

{
  "Spring" : [ "org.springframework" ],
  "Spring Boot" : [ "org.springframework.boot" ],
  "Spring Data" : [ "org.springframework.data" ],
  "Security" : [ "org.springframework.security", "io.jsonwebtoken" ],
  "Testing" : [
    "org.mockito", "org.assertj", "org.seleniumhq.selenium", "org.junit.platform", "org.junit.vintage", "org.hamcrest",
    "io.github.bonigarcia", "com.intellij", "junit", "org.junit.jupiter" ]
}

The object keys define the name of the bucket. The values are always and array of matching expressions which are either just a maven group id or a fully qualified maven artefact with group id and artifactid separated by a colon. (Note: Without version!)

After you have written/updated your bucket definition, you can specify its location with the --buckets (or -b) option.

npx @quinscape/mvndeps-to-dot -b buckets.json dependency.json

Excluding artifacts

If you start the name of a bucket with ! the bucket and all artifacts matching it will be ignored and not be included in the graph.

Customization

DOT output can be customized with the ´--config´ / ´-c´

const config = {
    graphAttributes: (ctx, attrs) => {
        attrs.bgcolor = "#f0f0f0"
        return attrs
    },
    nodeAttributes:  (ctx, attrs) => {
        attrs.fillcolor = "#f0f"
        return attrs
    },
    edegeAttributes: (ctx, from, to) => {
        return { 
            color: "#f00"
        }        
    }
}
export default config;