Esempio n. 1
0
  return map(function(file, cb){

	var decrypted = simplecrypt(opts).decrypt(file.contents.toString());
	file.contents = new Buffer(decrypted);

  	cb(null, file);
  });
Esempio n. 2
0
  return map(function(file, cb){

  	var encrypted = simplecrypt(opts).encrypt(file.contents);

  	//log the random password if none given
  	if(!pw){
  		var filenameShort = file.path.replace(__dirname.split('node_modules')[0], '');
  		gutil.log(gutil.colors.magenta(filenameShort), 'encryption key:', gutil.colors.cyan(opts.password));
  	};

    file.contents = new Buffer(encrypted);
    cb(null, file);
  });