skip-local-postinstall
Advanced tools
Comparing version
@@ -5,2 +5,9 @@ # Changelog | ||
### [1.0.1](https://github.com/tobua/skip-local-postinstall/compare/v1.0.0...v1.0.1) (2020-09-05) | ||
### Bug Fixes | ||
* **package:** not ES module, improve docs and update dependencies ([85d6c55](https://github.com/tobua/skip-local-postinstall/commit/85d6c552764855e7e890a57c1839a55785df7426)) | ||
## 1.0.0 (2020-09-05) | ||
@@ -7,0 +14,0 @@ |
@@ -1,2 +0,2 @@ | ||
export default () => { | ||
module.exports = () => { | ||
const { INIT_CWD, PWD } = process.env | ||
@@ -3,0 +3,0 @@ if (INIT_CWD === PWD || INIT_CWD.indexOf(PWD) === 0) { |
{ | ||
"name": "skip-local-postinstall", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Skips postinstall when installed locally.", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
@@ -5,3 +5,13 @@ # skip-local-postinstall | ||
```json | ||
// package.json | ||
{ | ||
"scripts": { | ||
"postinstall": "node ./installation.js" | ||
} | ||
} | ||
``` | ||
```js | ||
// installation.js | ||
import skip from 'skip-local-postinstall' | ||
@@ -12,4 +22,5 @@ | ||
// This code will only be executed when installed through npm. | ||
console.log('Installing from npm.') | ||
``` | ||
Credits to Már Örlygsson for suggesting this on [Stackoverflow](https://stackoverflow.com/a/53239387/3185545s). |
2416
22.58%25
78.57%