Skip to content

A script that resets the resolved registry URLs in package lock to the official NPM registry.

License

Notifications You must be signed in to change notification settings

splashdust/package-lock-sanitizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

package-lock.json sanitizer

Commitizen friendly semantic-release Build Status Latest Version Greenkeeper badge

This tool rewrites the resolved URLs in package-lock.json, replacing the registry part of the URL with the offcial NPM registry URL (by default).

This is useful if you are working behind some kind of NPM proxy with an internal URL that you don't want to expose outside of your organisation. Add this script as a pre-commit hook to make sure that you don't commit those URLs to your repository.

Usage

Run this to see all the options

$ package-lock-sanitizer --help

Example usage as a pre-commit hook with Husky:

"husky": {
    "hooks": {
        "pre-commit": "npm run package-lock-sanitizer && git add package-lock.json"
    }
},

Don't forget to add "package-lock-sanitizer": "package-lock-sanitizer" to your scripts section.

About

A script that resets the resolved registry URLs in package lock to the official NPM registry.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •