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

mac-dependencies

v0.1.0

Published

A library to check dependencies of a given executable or dylib on Mac OSX

Readme

mac-dependencies

Mac-dependencies is a node.js module to "walk" dependencies of an executable or dylib on Mac. It will automatically resolve the @executable_path, @rpath and @loader_path paths to find dependent libraries.

Users can use it to print the dependencies, check which dependencies were missing, and build a DMG by copying dependent libraries of an executable on Mac (see its usage in GeoDa build toolchain).

Usage

1. print_deps()

print_deps(file_path : String, {options : Dict}) : String

Example:

const macdep = require('mac-dependencies');

macdep.print_deps('/usr/lib/libcurl.dylib');

Output:

└─ ✔ libcurl.dylib /usr/lib/libcurl.dylib
   ├─ ✔ libcrypto.42.dylib /usr/lib/libcrypto.42.dylib
   │  └─ ✔ libSystem.B.dylib /usr/lib/libSystem.B.dylib
   ├─ ✔ libssl.44.dylib /usr/lib/libssl.44.dylib
   │  ├─ ✔ libcrypto.42.dylib /usr/lib/libcrypto.42.dylib
   │  │  └─ ✔ libSystem.B.dylib /usr/lib/libSystem.B.dylib
   │  └─ ✔ libSystem.B.dylib /usr/lib/libSystem.B.dylib
   ├─ ✔ libapple_nghttp2.dylib /usr/lib/libapple_nghttp2.dylib
   │  └─ ✔ libSystem.B.dylib /usr/lib/libSystem.B.dylib
   ├─ ✔ libz.1.dylib /usr/lib/libz.1.dylib
   │  └─ ✔ libSystem.B.dylib /usr/lib/libSystem.B.dylib
   └─ ✔ libSystem.B.dylib /usr/lib/libSystem.B.dylib

1.1 Check missing dependencies

Any missing dependencies will be highlighed in the output with a "question mark" icon ❓.

Example:

macdep.print_deps('/Users/xun/test.dylib');

Output:

└─ ✔ test.dylib /Users/xun/test.dylib
   ├─ ❓ libpng16.16.dylib @rpath/libpng16.16.dylib
   └─ ✔ libSystem.B.dylib /usr/lib/libSystem.B.dylib

1.2 Option: search_dirs

For missing dependencies, one can specify a list of search dirs as an option to tell the program to search any missing dependencies.

Example:

var opts = {"search_dirs" : ["/usr/lib", "/usr/local/lib"]};
macdep.print_deps('/Users/xun/test.dylib', opts);

Output:

└─ ✔ test.dylib /Users/xun/test.dylib
   ├─ ✔ libpng16.16.dylib /usr/local/lib/libpng16.16.dylib
   └─ ✔ libSystem.B.dylib /usr/lib/libSystem.B.dylib

1.3 Option: system_dirs

Default value: ['/usr/lib/system', '/Library/System']

One can specify a list of system dirs as an option to tell the program to ignore when searching dependencies.

Example:

var opts = {
    "system_dirs" : ["/usr/lib"], 
    "search_dirs" : ["/usr/lib", "/usr/local/lib"]
};
macdep.print_deps('/Users/xun/test.dylib', opts);

Output:

└─ ✔ test.dylib /Users/xun/test.dylib
   └─ ✔ libpng16.16.dylib /usr/local/lib/libpng16.16.dylib

2. get_deps()

get_deps(file_path : String, {options : dict}) : object

Example:

const macdep = require('mac-dependencies');

var dep = macdep.get_deps('/usr/lib/libcurl.dylib');

Returns a javascript object representing the tree structure of dependencies. For example:

dep {
   // attributes
   this.file_path = '/Users/xun/test.dylib', // 
   this.file_name = 'test.lib', //
   this.is_system = false, //
   this.is_valid = true, //
   this.dependencies = ['/usr/local/lib/libpng16.16.dylib', // a list of dependencies as dep objects
                        '/usr/lib/libSystem.B.dylib'], 
   this.executable_path = '/Users/xun',
   this.loader_path = '/Users/xun',
   this.r_path = undefined
}

One can traverse this tree structure starting from the return object by get_deps() function, and looping its children in dependencies[].

Contact

Xun Li lixun at gmail.com