2.0.1 • Published 4 years ago

in-publish v2.0.1

Weekly downloads
4,746,974
License
ISC
Repository
github
Last release
4 years ago

in-publish

For background, see npm#10074.

Detect if we were run as a result of npm publish. This is intended to allow you to easily have prepublish lifecycle scripts that don't run when you run npm install.

$ npm install --save-dev in-publish
in-publish@1.0.0 node_modules/in-publish

Then edit your package.json to have:

  "scripts": {
    "prepublish": "in-publish && thing-I-dont-want-on-dev-install || not-in-publish"
  }

Now when you run:

$ npm install

Then thing-I-dont-want-on-dev-install won't be run, but...

$ npm publish

And thing-I-dont-want-on-dev-install will be run.

It's worth noting that the prepublish lifecycle is ALSO called when you build a tarball, so:

$ npm pack

Will call your prepublish lifecycle, but with the example above, thing-I-dont-want-on-dev-install won't be run.

If you want this, you can use another helper included here:

  "scripts": {
    "prepublish": "not-in-install && thing-I-dont-want-on-dev-install || in-install"
  }

The above will run your thing-I-dont-want-on-dev-install on publish and on pack but not on install.

strider-npm-publishbb-chatkununu-electrode-react-webappnode-sass-win32-x64-n4-n5-binnode-sass-linux-win32-x64-n4-n5-bin@infinitebrahmanuniverse/nolb-in-@everything-registry/sub-chunk-1909cute-logcute-log2customstf_ioscycle-react-driverdigital-keyboard-demosdebukconfluxcondense-numberdevez-node-sassdouble-agent-validatordodpjsdrmimeerror-catetholowesqueueeslint-import-resolver-sanityeslint-config-textio-baseelectrode-react-webappelectrode-react-webapp-multipageeslint-config-honu-baseelastiqfhir2fis-msprd-node-sass_4_1_1fis-msprd-node-sass_4_2_0fis-msprd-node-sass_4_3_0ftl-enginegenerator-javascript-librarygenerator-update-yeoman-testgigya-dev-toolkitgenerator-poi-boilerplateg2a-node-sassgagglegleipnirlkpm-clilkpm-packermiguelcostero-ng2-toastymead-plugin-signature-md5mead-plugin-source-fsmead-plugin-source-gcsmead-plugin-source-proxymead-plugin-source-resolver-configmead-plugin-source-s3mead-plugin-source-webfolderlwp-toolsjsdoc-export-default-interopjsxstyle-es2015jsreport-sekure-dispatcherjsreport-sekure-exportjsreport-responsivepaper-pdfjsreport-weasyprintjsreport-imagesjsreport-keycloak-authjson-sass-varshubot-songlinkicons-vue-testhadron-buildhapi-decoratorsgraphql-zealotgrumbler-scriptsnes-node-sass-prebuiltnode-sass-chinanode-sass-hellanodezoo-webmutexmrbuildermujimozu-validate-npm-packagemq-propsnuxtjs-argonnpm-all-packagesnlp-mitienode-yang-testnode-sass-vendornode-sass-with-bindingsnode-sass-wittibsnode-sass-macnode-sass-prebuiltnode-scientistnode-sass-temppkg-fetch-mkgpkg-mkgphpmorphytestnpmzhangtongchuantlrlsymmetrical-happinessswf-graphsourcemap-decorate-callsitesstfstf-private-testingstf-patchedstriderslidewindersanity-plugin-debug
2.0.1

4 years ago

2.0.0

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.0

9 years ago