Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ninesalt authored Jun 24, 2020
1 parent b9d3e49 commit 65319a8
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,18 @@ You can use it as follows. In your `package.json`, add a new script to run:
```
Then when you run `npm run pre-run` it will automatically figure out what needs to happen.

You can also do this programatically:

**Programatically**

```
const installChanged = require('install-changed')
const isModified = installChanged.watchPackage()
const isModified = installChanged.watchPackage({
hashFilename: '.packagehash',
installCommand: 'npm ci'
})
```

The function above does exactly the same thing, additonally it also returns a boolean value which you might find useful.

### Options

**CLI**
Expand All @@ -48,14 +50,3 @@ install-changed --hash-filename .packagehash --install-command "npm ci"
This will use the file `.packagehash` to store a hash of the installed dependencies and run `npm ci` instead of `npm install` when packages need to be installed / updated.

There may be some cases you just only want to update the hash. For example, when you are installing a new package you don't want the script to install the package again later. You can use the `---hash-only` for that.

**Programatically**

```
const installChanged = require('install-changed')
const isModified = installChanged.watchPackage({
hashFilename: '.packagehash',
installCommand: 'npm ci'
})
```

0 comments on commit 65319a8

Please sign in to comment.