Dia antes primera install

This commit is contained in:
2025-12-08 15:20:28 -06:00
commit 1416478c9c
4130 changed files with 886376 additions and 0 deletions

15
node_modules/node-zip/.npmignore generated vendored Normal file
View File

@@ -0,0 +1,15 @@
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz
pids
logs
results
node_modules
npm-debug.log

2
node_modules/node-zip/Makefile generated vendored Normal file
View File

@@ -0,0 +1,2 @@
all:
bin/packer

64
node_modules/node-zip/README.md generated vendored Normal file
View File

@@ -0,0 +1,64 @@
node-zip
========
node-zip - Zip/Unzip files ported from JSZip
Installation
------------
npm install node-zip
Usage
-----
Zip:
var zip = new require('node-zip')();
zip.file('test.file', 'hello there');
var data = zip.generate({base64:false,compression:'DEFLATE'});
console.log(data); // ugly data
Unzip:
var zip = new require('node-zip')(data, {base64: false, checkCRC32: true});
console.log(zip.files['test.file']); // hello there
You can also load directly:
require('node-zip');
var zip = new JSZip(data, options)
...
Write to a file (IMPORTANT: use *binary* encode, thanks to @Acek)
var fs = require("fs");
zip.file('test.txt', 'hello there');
var data = zip.generate({base64:false,compression:'DEFLATE'});
fs.writeFileSync('test.zip', data, 'binary');
Testing
-------
npm install -g jasmine-node
jasmine-node test
Manual
------
node-zip uses JSZip, please refer to their website for further information:
http://stuartk.com/jszip/
Contributors
------------
> David Duponchel [@dduponchel](https://github.com/dduponchel)
Feel free to send your pull requests and contribute to this project
License
-------
MIT

2
node_modules/node-zip/bin/nodezip generated vendored Executable file
View File

@@ -0,0 +1,2 @@
#!/usr/bin/env node
var fs=require("fs"),JSZip=require("jszip"),path=require("path"),args=process.argv.slice(2),zip=new JSZip;if(/-h|-H|--help|-\?/.test(args)||!args.length){printHelp()}else{var command=args.shift();if(command=="-c"){var zipfile=args.shift();console.log("Creating %s...",zipfile);args.forEach(function(file){if(fs.existsSync(file)){addFile(file)}else{console.error("Error: file %s not found.",file);process.exit(2)}});console.log("Deflating...");fs.writeFileSync(zipfile,zip.generate({type:"nodebuffer",compression:"DEFLATE"}));console.log("Done.")}else if(command=="-x"){var zipfile=args.shift();var destination=args.shift();var zipdata=fs.readFileSync(zipfile);console.log("Reading %s...",zipfile);try{var zip=new JSZip(zipdata,{checkCRC32:true})}catch(e){console.error("Error: invalid file");process.exit(2)}Object.keys(zip.files).forEach(function(filepath){file=zip.files[filepath];if(destination)filepath=destination+path.sep+filepath;if(file.options.dir){console.log(" Creating",filepath);mkdirRecursively(filepath)}else{console.log(" Inflating",filepath);fs.writeFileSync(filepath,file.asNodeBuffer())}});console.log("Done.")}else{console.error("Error: wrong command");printHelp()}}function printHelp(){console.error("Usage:");console.error(" -c zipfile file1 [file2] [...] Create zip file with file/directory list");console.error(" -x zipfile [destination] Extract zip file");console.error(" -h | -H | --help | -? Show help");process.exit(1)}function addFile(filepath){if(fs.lstatSync(filepath).isDirectory()){console.log(" Adding folder",filepath);zip.folder(filepath);var directory=fs.readdirSync(filepath);directory.forEach(function(subfilepath){addFile(path.join(filepath,subfilepath))})}else{console.log(" Adding file",filepath);zip.file(filepath,fs.readFileSync(filepath,"binary"))}}function mkdirRecursively(folderpath,mode){try{fs.mkdirSync(folderpath,mode);return true}catch(e){if(e.errno==34){mkdirRecursively(path.dirname(folderpath),mode);mkdirRecursively(folderpath,mode)}else if(e.errno==47){return true}else{console.log("Error: Unable to create folder %s (errno: %s)",folderpath,e.errno);process.exit(2)}}}

8
node_modules/node-zip/bin/packer generated vendored Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
type -P uglifyjs &>/dev/null || { npm install uglify-js -g; }
echo "#!/usr/bin/env node" > bin/nodezip
cat lib/nodezip-cli.js >> bin/nodezip.tmp
uglifyjs bin/nodezip.tmp >> bin/nodezip
rm bin/nodezip.tmp
chmod +x bin/nodezip
echo "done: bin/nodezip"

92
node_modules/node-zip/lib/nodezip-cli.js generated vendored Normal file
View File

@@ -0,0 +1,92 @@
var fs = require('fs'),
JSZip = require('jszip'),
path = require('path'),
args = process.argv.slice(2),
zip = new JSZip();
if(/-h|-H|--help|-\?/.test(args)||!args.length) {
printHelp();
} else {
var command = args.shift();
if(command == '-c') {
var zipfile = args.shift();
console.log('Creating %s...', zipfile);
args.forEach(function(file) {
if(fs.existsSync(file)) {
addFile(file);
} else {
console.error('Error: file %s not found.', file);
process.exit(2);
}
});
console.log("Deflating...")
fs.writeFileSync(zipfile, zip.generate({type:"nodebuffer", compression:'DEFLATE'}));
console.log("Done.")
} else if(command == '-x') {
var zipfile = args.shift();
var destination = args.shift();
var zipdata = fs.readFileSync(zipfile);
console.log('Reading %s...', zipfile);
try {
var zip = new JSZip(zipdata, {checkCRC32: true});
} catch(e) {
console.error("Error: invalid file");
process.exit(2);
}
Object.keys(zip.files).forEach(function(filepath) {
file = zip.files[filepath];
if (destination) filepath = destination + path.sep + filepath
if(file.options.dir) {
console.log(' Creating', filepath);
mkdirRecursively(filepath);
} else {
console.log(' Inflating', filepath);
// TODO: add prompt if file exists
fs.writeFileSync(filepath, file.asNodeBuffer());
}
});
console.log('Done.');
} else {
console.error('Error: wrong command')
printHelp();
}
}
function printHelp() {
console.error('Usage:');
console.error(' -c zipfile file1 [file2] [...] Create zip file with file/directory list');
console.error(' -x zipfile [destination] Extract zip file');
console.error(' -h | -H | --help | -? Show help');
process.exit(1);
}
function addFile(filepath) {
if(fs.lstatSync(filepath).isDirectory()) {
console.log(" Adding folder", filepath);
zip.folder(filepath);
var directory = fs.readdirSync(filepath);
directory.forEach(function(subfilepath) {
addFile(path.join(filepath,subfilepath));
});
} else {
console.log(" Adding file", filepath)
zip.file(filepath, fs.readFileSync(filepath, 'binary'));
}
}
function mkdirRecursively(folderpath, mode) {
try {
fs.mkdirSync(folderpath, mode);
return true;
} catch(e) {
if (e.errno == 34) {
mkdirRecursively(path.dirname(folderpath), mode);
mkdirRecursively(folderpath, mode);
} else if (e.errno == 47) {
return true;
} else {
console.log("Error: Unable to create folder %s (errno: %s)", folderpath, e.errno)
process.exit(2);
}
}
};

5
node_modules/node-zip/lib/nodezip.js generated vendored Normal file
View File

@@ -0,0 +1,5 @@
var fs = require('fs');
var JSZip = require('jszip');
global.JSZip = JSZip;
module.exports = function(data, options) { return new JSZip(data, options) };

35
node_modules/node-zip/package.json generated vendored Normal file
View File

@@ -0,0 +1,35 @@
{
"author": "Diego Araos <d@wehack.it> (http://wehack.it/)",
"name": "node-zip",
"description": "node-zip - Zip/Unzip files ported from JSZip",
"version": "1.1.1",
"homepage": "https://github.com/daraosn/node-zip",
"repository": {
"url": "git://github.com/daraosn/node-zip.git"
},
"contributors": [
{
"name": "David Duponchel",
"email": "d.duponchel@gmail.com"
}
],
"keywords": [
"zip",
"unzip",
"jszip",
"node-zip",
"compression"
],
"bin": {
"nodezip": "bin/nodezip"
},
"main": "lib/nodezip.js",
"dependencies": {
"jszip" : "2.5.0"
},
"devDependencies": {},
"optionalDependencies": {},
"engines": {
"node": "*"
}
}

41
node_modules/node-zip/test/nodezip_spec.js generated vendored Normal file
View File

@@ -0,0 +1,41 @@
describe('nodezip', function() {
beforeEach(function() {
this.nodezip = require('..')();
});
describe('when initialized', function() {
it('should load JSZip in this.nodezip', function() {
expect(this.nodezip.options).not.toBeNull();
});
it('should declare JSZip', function() {
expect(JSZip).not.toBeNull();
});
});
describe('when archiving a dummy file', function() {
beforeEach(function() {
this.fs = require("fs");
this.dummyFile = this.nodezip.file('test.file', 'hello there');
this.dummyFileData = this.dummyFile.generate({base64:false,compression:'DEFLATE'});
});
it('should contain valid data', function() {
expect(this.dummyFileData).not.toBeNull();
expect(this.dummyFileData).toMatch(/^PK/);
expect(this.dummyFileData).toMatch(/test.file/);
});
it('should be able to write file', function() {
this.fs.writeFileSync('test.zip', this.dummyFileData, 'binary');
expect(this.fs.lstatSync('test.zip')).not.toBeNull()
});
it('should be able to deflate file', function() {
this.dummyFileData = this.fs.readFileSync('test.zip', 'binary');
this.dummyFile = new JSZip(this.dummyFileData, {base64: false, checkCRC32: true});
expect(this.dummyFile.files['test.file'].asText()).toEqual("hello there");
this.fs.unlink('test.zip');
});
});
});