1.0.4 • Published 7 years ago
self-update-on-start v1.0.4
Self Update on Start
This module updates it's parent and all of it's parent's modules on start up. It spawns git pull
using the repository url found in package.json to and then spawns npm install --save
then npm upgrade --save
.
Usage
Don't store copies of npm repositories in your project's repository, use npm the way it was meant to be used! Make sure to run self-update-on-start at the very start of your program before requiring any dependencies. Put your project's main contents in another file so you never have to update index.js
and don't have to restart for changes to take effect! In your repository's .gitignore
file, exclude all of your node_modules and use '!' to make an exception for self-update-on-start.
Example index.js
const selfUpdate = require('self-update-on-start');
selfUpdate(() => {
require('./src/main.js')();
});
Example .gitignore
/node_modules/**
!/node_modules/self-update-on-start/**