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

grunt-init-pro

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-init-pro - npm Package Compare versions

Comparing version 0.1.1 to 1.0.0

2

package.json
{
"name": "grunt-init-pro",
"version": "0.1.1",
"version": "1.0.0",
"description": "Grunt init",

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

module.exports = function(grunt) {
var crypto = require('crypto');
var encrypt = require('cf-encrypt');
var path = require('path');
// Please see the Grunt documentation for more information regarding task
// creation: http://gruntjs.com/creating-tasks
grunt.registerMultiTask('init', 'The best Grunt plugin ever.', function() {
// Merge task-specific and/or target-specific options with these defaults.
var options = this.options();
if (!options.key) {
grunt.fail.warn('Missing key property.');
}
var key = options.key;
// Iterate over all specified file groups.
this.files.forEach(function(f) {
// Concat specified files.
var src = f.src.filter(function(filepath) {
// Warn on and remove invalid source files (if nonull was set).
if (!grunt.file.exists(filepath)) {
return false;
} else {
var filename = path.basename(filepath);
var newFilename = (grunt.file.isDir(options.dest) ? [filepath].join('.') : (options.ext) ? [options.dest, options.ext].join('.') : options.dest);
var contents = grunt.file.read(filepath);
if (!options.test2) {
var cipher = crypto.createCipher('aes-256-cbc', key)
cipher.update(contents, 'utf8', 'base64');
contents = cipher.final('base64')
}
else {
var decipher = crypto.createDecipher('aes-256-cbc', key);
decipher.update(contents, 'base64', 'utf8');
contents = decipher.final('utf8');
}
var contents = encrypt[(options.decrypt) ? 'decrypt' : 'encrypt'](options.key, grunt.file.read(filepath), 'hex');
grunt.file.write(newFilename, contents);

@@ -32,0 +21,0 @@ return true;

Sorry, the diff of this file is not supported yet

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