Last active
March 23, 2016 12:51
-
-
Save Zmetser/0f48d2163c4666d63573 to your computer and use it in GitHub Desktop.
Check how affected you are in the Azer gate. <= https://medium.com/@azerbike/i-ve-just-liberated-my-modules-9045c06be67c#.hfge17k9h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Usage: | |
* node check_unpublished.js ${PATH_TO_MODULES_DIR} | |
* | |
* Example: | |
* node check_unpublished.js ./node_modules/ | |
*/ | |
const fs = require('fs') | |
const request = require('request') | |
const AZER_GATE_URL = 'https://gist.githubusercontent.com/azer/db27417ee84b5f34a6ea/raw/50ab7ef26dbde2d4ea52318a3590af78b2a21162/gistfile1.txt' | |
fs.readdir(process.argv[2], (err, our_modules) => { | |
if (err) throw err | |
request.get(AZER_GATE_URL, (err, response, body) => { | |
if (err) throw err | |
const azer_modules = body.split('\n') | |
const conflicts = azer_modules.filter(module_name => our_modules.indexOf(module_name) !== -1) | |
if (conflicts.length) { | |
console.log(`${conflicts.length} conflicts were found!`); | |
console.log('Run `npm ls {module_name}` to see what dependencies are affected'); | |
console.log('Conflicts:\n -', conflicts.join('\n - ')); | |
} else { | |
console.log('You\'re good to go!'); | |
} | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment