You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

skip-local-postinstall

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

skip-local-postinstall - npm Package Compare versions

Comparing version

to
1.0.1

7

CHANGELOG.md

@@ -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 @@

2

index.js

@@ -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).