From 4370f40886b76fe2e3c6f6f9db84029c2bd6d75b Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Fri, 8 Nov 2024 00:06:33 +0900 Subject: [PATCH] Create archive.js --- lib/archive.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 lib/archive.js diff --git a/lib/archive.js b/lib/archive.js new file mode 100644 index 0000000..feed2fa --- /dev/null +++ b/lib/archive.js @@ -0,0 +1,27 @@ +// archive.js + +var ArchiveObject = function() { + this.engine = "HOW_TO_COMPRESS_AND_DECOMPRES_A_FILE + + this.create = function(engine) { + this.engine = engine; + } + + this.extractTo = function(targetDirectory) { + if (this.engine == "METHOD_1") { + // how to extract a file with METHOD_1 + } else (this.engine == "METHOD_2") { + // how to extract a file with METHOD_2 + } // ... + } + + this.compressDirectory = function(sourceDirectory) { + if (this.engine == "METHOD_1") { + // how to compress a file with METHOD_1 + } else (this.engine == "METHOD_2") { + // how to compress a file with METHOD_2 + } // ... + } + + // A good practice is lib/http.js +}