NPM-LINK(3)
π npm-link β NPM-LINK(3), the symlink-a-package-folder manual, bestie edition π
π NAME π
npm-link β symlink a package folder. That's the whole name vibe: link up a package folder so your local code and your global install can hold hands. π«Ά
β¨ SYNOPSIS β¨
npm.commands.link(callback)
npm.commands.link(packages, callback)
π¦ DESCRIPTION π¦
Okay so package linking? It is literally a two-step process. No cap. β¨
- Without parameters,
linkwill create a globally-installed symbolic link fromprefix/package-nameto the current folder. Global link, current folder, slay. π₯ - With parameters,
linkwill create a symlink from the localnode_modulesfolder to the global symlink. Localnode_modulesmeets global symlink, and they're linked. π
When creating tarballs for npm publish, the linked packages are "snapshotted" to their current state by resolving the symbolic links. Important little detail, bestie: the snapshot happens by resolving those symbolic links. π
This is handy for installing your own stuff, so that you can work on it and test it iteratively without having to continually rebuild. Obsessed β iterative testing without the endless rebuild loop. π
For example:
npm.commands.link(cb) # creates global link from the cwd
# (say redis package)
npm.commands.link('redis', cb) # link-install the package
Now, any changes to the redis package will be reflected in the package in the current working directory. That's the whole linked-package moment, iykyk. π
π That's the manual NPM-LINK(3), dated March 2017 β source/version and date all wrapped up with a bow. Go symlink something iconic. ππ
π¦ where this page comes from
- nixos 26.05: hueadm 1.2.1
- nixpkgs unstable: hueadm 1.2.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms