NPM-PACK(3)

πŸ“¦ version 1.2.1, in nixos 26.05, nixpkgs unstable

πŸ’– NPM-PACK(3) πŸ’–

okay so bestie, welcome to the npm-pack page from the npm manual β€” yes that npm, the one in your node_modules that weighs more than your feelings πŸ’€. This is the lowkey iconic one that makes tarballs. let's get into it ✨


✨ NAME ✨

npm-pack β€” create a tarball from a package πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

npm.commands.pack([packages,] callback)

that's it. that's the whole vibe check. packages is optional, callback is not πŸ‘‘


🌸 DESCRIPTION 🌸

okay so here's the tea β˜• β€” for anything that's installable, this command will scoop it up and handle it. and when I say anything, I mean anything, bestie:

  • a package folder πŸ“
  • a tarball πŸ—œοΈ
  • a tarball url πŸ”—
  • name@tag 🏷️
  • name@version πŸ”’
  • or just a plain name ✨

it fetches it to the cache first (yes, the cache, we love a shortcut πŸ’…), then copies the tarball to the current working directory as <name>-<version>.tgz, and then writes the filenames out to stdout. so you literally get receipts 🧾 periodt.

πŸ’€ heads up bestie: if the same package is specified multiple times, then the file will be overwritten the second time. no cap, it just goes poof and gets replaced. don't come crying to me about it πŸ™ˆ

and if no arguments are supplied at all? then npm packs the current package folder. main character energy fr fr β€” it just packs you 🫢


✨ that's the whole page ✨ β€” this little gem is from March 2017, living in the NPM-PACK(3) manual section. go forth and tarball responsibly, ily, bye πŸ’œπŸŽ€πŸ¦‹

πŸ“¦ where this page comes from