Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

automatic-updates

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

automatic-updates - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

11

index.js

@@ -5,3 +5,3 @@ /*

const shell = require('shelljs')
const conf = require('node-etc');
const conf = require('../node-etc');
const events = require('events');

@@ -53,8 +53,2 @@ // const eventEmitter = new events.EventEmitter();

this.source = options.source
// this.on('updated', restartFunc);
console.log('````````````````````````````')
console.log('````````````````````````````')
// console.log(restartFunc)
console.log('````````````````````````````')
console.log('````````````````````````````')

@@ -174,2 +168,3 @@ if (typeof this.interval !== 'number') throw Error(`Invalid interval type for ${this.interval}`)

let update = shell.exec(`cd ${packageJsonDir} && yarn install || npm install`, { silent: true })
if (!update.includes('Already up-to-date')) {

@@ -179,3 +174,3 @@ // shell.exec(`cd ${packageJsonDir} && yarn install`);

}else{
this.emit('not updated', new Date().getTime())
this.emit('notUpdated', new Date().getTime())
}

@@ -182,0 +177,0 @@ }

{
"name": "automatic-updates",
"version": "1.0.2",
"version": "1.0.3",
"description": "Tools to automatically update nodejs programs installed as modules from npm/github.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -30,6 +30,8 @@ # automatic-updates

```node
```javascript
const automaticUpdates = require('automatic-updates');
automaticUpdates.on('updated', ()=>{
process.exit() // what to do restart the service in case of an update
});
automaticUpdates.init()
```

@@ -36,0 +38,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc