Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frontend Package.json change watcher

Check if the package.json has changed and warn the user.

Gulp tasks

import watcher from 'front-package-watcher/watcher/gulp-watcher.js'

gulp.task(
    'check-package',
    () => {
        return gulp
                .src( 'package.json' )
                .pipe( watcher() );
    }
);

gulp.task(
    'save-package',
    () => {
        return gulp
        .src( 'package.json' )
        .pipe( watcher( 'update-cache' ) );
    }
);

Check command

To check if the package change:

$ gulp check-package

Cache update command

After a package install, run:

$ gulp save-package

It will update the cached file which we compare to.

Auto cache update

Add the cache update command in the postinstall property of the npm-scripts:

{
    ...,
    "scripts": {
        "postinstall": "gulp save-package"
    },
    ...
}

Options

You can list the properties to check in the options.

These are the default options:

    watcher( {
        "properties": [ 'dependencies', 'devDependencies' ]
    } );

About

Gulp plugin that stop the build if package.json has changed and npm install wasn't done

Resources

Stars

0 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages