Skip to content

Instantly share code, notes, and snippets.

@ddprrt
Created April 13, 2017 09:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ddprrt/6178d3ce2ae66f97c3689622c4834bdd to your computer and use it in GitHub Desktop.
Save ddprrt/6178d3ce2ae66f97c3689622c4834bdd to your computer and use it in GitHub Desktop.
Blacklisted plugins
const fetch = require('node-fetch');
const modules = require('./package.json');
const blacklist = 'https://raw.githubusercontent.com/gulpjs/plugins/master/src/blackList.json';
gulp.task('check-plugins', () => {
return fetch(blacklist)
.then(response => response.text())
.then(result => JSON.parse(result))
.then(black => {
['dependencies', 'devDependencies'].forEach(el => {
Object.keys(modules[el]).forEach(key => {
if(!!black[key]) throw new Error('blacklisted software used')
});
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment