npm 11 🌐 Lifecycle Scripts (pre, post, prepare, prepublishOnly)
npm lifecycle scripts are hooks that run automatically at specific points in a package’s lifecycle—during install, pack, publish, or when a user-defined script is invoked. The pre and post prefixes are the general mechanism: any script named prefoo runs before foo, and postfoo runs after it . The special scripts prepare, prepublishOnly, and the deprecated…