• Stars
    star
    195
  • Rank 195,391 (Top 4 %)
  • Language
    JavaScript
  • License
    BSD 3-Clause "New...
  • Created over 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

node disk usage

ndu

Visualize your Node app's disk space usage

Requires node 10.13+ and du. Windows not yet supported.

ndu is a tool for analyzing the size of dependencies in a node.js application. It's similar to disc, but for server-side dependencies instead of client-side dependencies.

When building node.js apps, you can choose from hundreds of thousands of libraries available on npm. But sometimes these libraries contain many hidden sub-dependencies that bloat the size of your application. This tool helps you identify which modules are bringing in the bloat. It's very useful when you're wondering why your seemingly simple node app takes up hundreds of MBs of space on disk.

Installation

Install from npm:

npm install --global ndu

Usage

Simply run ndu in the root folder of your node.js application.

By default it will write an HTML file with the results to stdout:

ndu > ndu.html && open ndu.html

Just like disc, ndu can also open the result directly in a browser:

ndu --open

Example

First, let's create a very simple web app using express-generator:

$ npm install -g express-generator
$ express example-web-app
$ cd example-web-app/
$ npm install

Now we have a simple web app built with express.js. Let's see how large the dependency tree is using ndu:

$ npm install -g ndu
$ ndu --open

This opens your web browser and shows a breakdown of your app's dependency tree:

ndu screenshot

From here you can see that your app is using 9.64MB of node dependencies. You can highlight areas of the diagram to see which node dependencies use up that space:

ndu

This can be especially helpful in a large application. Sometimes just a few dependencies make up the majority of your application's size.

For example, here's a real application that was running at Groupon. You can easily see how one bloated dependency was increasing the size of the application by 10%:

ndu screenshot 2

Thanks to ndu, it was easy to clean up the largest dependencies and quickly shrink the size of the app's footprint.

Similar Tools

  • disc: For analyzing the size of browserify bundles, platform independent
  • space-hogs: Generic directory size info, highlights big entries, *nix
  • WinDirStat: Generic directory size info, Windows
  • Grand Perspective: Generic directory size info, OSX

More Repositories

1

greenscreen

CoffeeScript
1,197
star
2

Selenium-Grid-Extras

Simplify the management of the Selenium Grid Nodes and stabilize said nodes by cleaning up the test environment after the build has been completed
Ruby
538
star
3

DotCi

DotCi Jenkins github integration, .ci.yml http://groupon.github.io/DotCi
Java
500
star
4

sparklint

A tool for monitoring and tuning Spark jobs for efficiency.
Scala
356
star
5

grox

Grox helps to maintain the state of Java / Android apps.
Java
339
star
6

testium

⛔️ [DEPRECATED] see https://github.com/testiumjs/testium-mocha
CoffeeScript
305
star
7

gleemail

Making email template development fun! Sort of!
CoffeeScript
293
star
8

ansible-silo

Ansible in a self-contained environment via Docker.
Shell
203
star
9

odo

A Mock Proxy Server
Java
151
star
10

spark-metrics

A library to expose more of Apache Spark's metrics system
Scala
145
star
11

cson-parser

Simple & safe CSON parser
JavaScript
132
star
12

FeatureAdapter

FeatureAdapter (FA) is an Android Library providing an optimized way to display complex screens on Android.
Java
113
star
13

dependency-injection-checks

Dependency Injection Usage Checks
Java
97
star
14

node-cached

A simple caching library for node.js, inspired by the Play cache API
JavaScript
94
star
15

luigi-warehouse

A luigi powered analytics / warehouse stack
Python
87
star
16

codeburner

Security-focused static code analysis for everyone
Ruby
83
star
17

gofer

A general purpose service client library for node.js
JavaScript
83
star
18

locality-uuid.java

Java
80
star
19

jesos

Java
51
star
20

swagql

Create a GraphQL schema from swagger spec
JavaScript
46
star
21

quinn

A set of convenient helpers to use promises to handle http requests
JavaScript
40
star
22

robo-remote

RoboRemote is a remote control framework for Robotium. The goal of RoboRemote is to allow for more complex test scenarios by letting the automator write their tests using standard desktop Java/JUnit. All of the Robotium Solo commands are available. RoboRemote also provides some convencience classes to assist in common tasks such as interacting with list views.
Java
40
star
23

webdriver-http-sync

sync http implementation of the WebDriver protocol for Node.js
JavaScript
39
star
24

mysql_slowlogd

Daemon that serves MySQL's slow query log via HTTP as a streaming download
Shell
36
star
25

mongo-deep-mapreduce

Use Hadoop MapReduce directly on Mongo data
Java
30
star
26

tdsql

Run SQL queries against a Teradata data warehouse server
Perl
29
star
27

nlm

Lifecycle manager for node projects
JavaScript
29
star
28

selenium-download

allow downloading of latest selenium standalone server and chromedriver
JavaScript
29
star
29

monsoon

An extensible monitor system that checks java processes and exposes metrics based on them.
Java
28
star
30

backbeat

A workflow service for processing asynchronous tasks across distributed systems
Ruby
28
star
31

Message-Bus

Java
25
star
32

retromock

Like Wiremock for Retrofit, but faster.
Java
24
star
33

report-card

An Open Source Report Card
JavaScript
23
star
34

nakala

Java
22
star
35

assertive

Assertive is a terse yet expressive assertion library
JavaScript
21
star
36

locality-uuid.rb

Ruby
18
star
37

javascript

Guidelines for using Javascript at Groupon
JavaScript
16
star
38

KatMaps

Kotlin
15
star
39

shellot

Slim terminal realtime graphing tool
Ruby
14
star
40

roll

roll - bootstrap or upgrade a Unix host with Roller
C
13
star
41

sycl

Simple YAML Config Library
Ruby
13
star
42

vertx-utils

Java
12
star
43

baryon

Baryon is a library for building Spark Streaming applications that consume data from Kafka.
Scala
11
star
44

params_deserializers

Deserializers for Rails params
Ruby
11
star
45

poller

Poll a URL, and trigger code on changes
Ruby
10
star
46

git-workflow

JavaScript
10
star
47

json-schema-validator

Maven plugin to validate json files against a json schema. Uses https://github.com/fge/json-schema-validator library under the covers
Java
10
star
48

mysql-junit4

Java
9
star
49

vertx-memcache

Java
9
star
50

shared-store

Keeping config data in sync
JavaScript
9
star
51

artemisia

A light-weight configuration driven Data-Integration utility
Scala
8
star
52

pg_consul

C++
8
star
53

vertx-redis

Java
7
star
54

phy

Minimal hyperscript helpers for Preact
JavaScript
6
star
55

mezzanine

Mezzanine is a library built on Spark Streaming used to consume data from Kafka and store it into Hadoop.
Scala
6
star
56

DotCi-Plugins-Starter-Pack

DotCi-Plugins-Starter-Pack - Expansion-pack for DotCi
Java
6
star
57

Novie

Java
5
star
58

backbeat_ruby

A Ruby client for Backbeat workflow service
Ruby
4
star
59

nilo

A dependency injection toolset for building applications
JavaScript
3
star
60

promise

Java
3
star
61

schema-inferer

Scala
2
star
62

two-to-three

Swagger to Open API Converter
Java
2
star
63

assertive-as-promised

extends assertive with promise support
CoffeeScript
2
star
64

jtier-ctx

Java
2
star
65

kmond

Kotlin
2
star
66

api-build-resources

Build related resources files, e.g. checkstyle configs, etc.
2
star
67

tiquette

Have some etiquette. Format your commit messages with a ticket or issue number.
TypeScript
2
star
68

gofer-proxy

Use a `gofer` client as an express middleware
JavaScript
1
star
69

gh-grep

GitHub CLI grep extension
TypeScript
1
star
70

stylint-config-groupon

CSS
1
star
71

coffeelint-config-groupon

CoffeeScript lint setting used at Groupon
JavaScript
1
star
72

installed-package

Run your node tests against an installed version of your package
JavaScript
1
star
73

api-parent-pom

Project to contain parent pom for common plugin configuration across all API team Maven projects.
1
star
74

jdbi-st4

1
star
75

gh-bulk-pr

GitHub CLI bulk-pr extension
TypeScript
1
star