NPM-RESTART(3)
π npm-restart(3) β like, the whole manual page, bestie
okay so real quick: this is the page for npm-restart, section 3 of the manual. Yes, section 3. Yes, that's a thing. Sit with it. π«Ά
β¨ NAME β¨
npm-restart β restart a package. that's it. that's the whole vibe. π₯
π SYNOPSIS π
npm.commands.restart(packages, callback)
like literally that's the call. packages, then callback. no cap. π
πΈ DESCRIPTION πΈ
okay so what this does is it restarts a package β and honestly? it'll restart multiple packages too, it's not gonna gatekeep. π
here's the thing tho, it's not just one script. it runs a package's "stop", "restart", and "start" scripts β plus all the associated pre- and post- scripts β in this exact order, no improvising:
prerestartprestopstoppoststoprestartprestartstartpoststartpostrestart
nine whole steps. it's giving choreography. π§
and if you don't specify a version? it restarts the "active" version. the main character version. β
oh and β npm can restart multiple packages, bestie. you just pass multiple packages in the packages parameter. that's it. that's the whole trick. π
π NOTE π
heads up, this one matters: the"restart"script gets run in addition to the"stop"and"start"scripts β not instead of them. so don't be out here thinkingrestartreplacesstop+start, because it does not. all three show up. π
this is the behavior as of npm major version 2. and if this behavior ever changes? it'll come with an increase in the major version number. periodt. π
π¦ SEE ALSO π¦
npm apihelp startnpm apihelp stop
mwah π that's the whole page β brought to you by the March 2017 edition, straight out of the npm docs, and rewritten with so much love you'd think it was a text from your bestie at 2am. go restart something. slay. π
π¦ 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