____ _ ____ ____ ____ | _ \(_) ___ ___/ ___/ ___| / ___| | |_) | |/ __/ _ \___ \___ \| | _ | __/| | (_| (_) |__) |__) | |_| | |_| |_|\___\___/____/____/ \____|

PicoSSG v6 Dependency Sizes

2025-08-05

PicoSSG currently has four dependencies. These are:

So chalk is really the only one that can be called overhead, since it just makes output nice and is used only for error messages. Why still keep it? Mainly because handling output on the various platforms will probably be a pain, so I feel its worth having it. Another good thing, chalk has 0 dependencies and fits well with PicoSSG's philosophy.

But let's look at all the dependency sizes, just to have it written down for v6.0.0 and be able to compare or just look it up and make it a marketing argument (you can use too 😎).

Dependency Sizes

Let's go big to small.

Nunjucks

Aside markdown the template engine is the most important feature of PicoSSG. So it's fair to occupy some space with it. And 2MB is ok, speaking in nodejs terms. Also npm says it has 3 dependencies and 1.7MB in size, so this seems reasonable.

> npm i nunjucks
added 4 packages, and audited 5 packages in 494ms

> du -h -d 1 node_modules/ | sort -hr
2.0M    node_modules/
1.8M    node_modules/nunjucks
120K    node_modules/commander
 52K    node_modules/asap
 20K    node_modules/a-sync-waterfall
  0B    node_modules/.bin

Markdown-it

The other core package is markdown-it, which is used to process markdown files. It is a bit smaller than nunjucks. It adds 1.8MB to the node_modules folder. Fine.

> npm i markdown-it
added 7 packages, and audited 8 packages in 558ms

> du -h -d 1 node_modules/ | sort -hr
1.8M    node_modules/
884K    node_modules/markdown-it
568K    node_modules/entities
184K    node_modules/argparse
 68K    node_modules/linkify-it
 56K    node_modules/mdurl
 48K    node_modules/uc.micro
 48K    node_modules/punycode.js
  0B    node_modules/.bin

Yaml

For parsing YAML front matter in markdown files, yaml is used. And it adds 1.2MB to the node_modules folder. We are at: 2 + 1.8 + 1.2 = 5MB, which is still ok for a nodejs package.

> npm i yaml
added 1 package, and audited 2 packages in 804ms

> du -h -d 1 node_modules/ | sort -hr
1.2M    node_modules/yaml
1.2M    node_modules/
  0B    node_modules/.bin

Chalk

Here comes the smallest package, chalk. But one that improves UX/DX by so much, that I want to keep it and it's impact on the overall size is negligible.

> npm i chalk
added 1 package, and audited 2 packages in 839ms

> du -h -d 1 node_modules/ | sort -hr
 76K    node_modules/
 72K    node_modules/chalk

All Together

After installing all packages, the total size of the node_modules folder is 5.1MB, and you can see all the dependencies listed below.

> npm i chalk nunjucks markdown-it yaml
added 12 packages, and audited 14 packages in 828ms

> du -h -d 1 node_modules/ | sort -hr
5.1M    node_modules/
1.8M    node_modules/nunjucks
1.2M    node_modules/yaml
884K    node_modules/markdown-it
568K    node_modules/entities
184K    node_modules/argparse
120K    node_modules/commander
 72K    node_modules/chalk
 68K    node_modules/linkify-it
 56K    node_modules/mdurl
 52K    node_modules/asap
 48K    node_modules/uc.micro
 48K    node_modules/punycode.js
 20K    node_modules/a-sync-waterfall
  0B    node_modules/.bin

How (I learned to) Measure These?

I am purist and I think only du -sh is the right way to measure the size of a package. But you will be surprised how much npm screws with what you want to measure.

I started out just rm -Rf node_modules and then npm install nunjucks and then du -sh node_modules. First every time I did the rm and npm i <any-package> I got "89 packages installed" or so. WTF? Why? So I remove the package-lock.json and try again. Nope.

I realized that npm installs the dependencies listed in package.json. So I just empty the dependencies in package.json and then run npm install nunjucks again. Now I can measure the size of the node_modules folder.

I did not dig deeper into why npm does this. But I learned something.