Question

JavaScript Tar and zip this entire work directory

JavaScript

Tar and zip this entire work directory

Homework Answers

Answer #1

The tar command in Linux is often used to create .tar.gz or .tgz archive files. The tar command can extract the resulting archives, too.

However while using javascript if we want o use tar and zip the entie work directory the the following example code snippets can be used

const configPath = path.join(this.base, '.platform', data);
const createOpts = {gzip: true, cwd: configPath, sync: true};
const archive = tar.create(createOpts, fs.readdirSync(configPath));
Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
I need to create a function that will be able to to print an entire directory...
I need to create a function that will be able to to print an entire directory in C/C++. The function will use: void print (const phone dir[], int size){ //code } //print is the function name //const phone dir[] is the array being passed as the parameter. //int size is the other parameter which is (number of entries in directory already). //phone is a structure that has: char name[20]; char phone[13];
Time: 10 minutes Objective: Create, view and extract tar archives. Description:  In this activity, the student will...
Time: 10 minutes Objective: Create, view and extract tar archives. Description:  In this activity, the student will use the tar utility to create, view, and extract a tar archive and use it options to name the tar file and view files as they are being archived and extracted. 1.     Start your Linux server virtual machine and sign-on with your individual user ID.  All Activities should begin in your home directory. 2.    Create a directory by typing  mkdir Act6-1 and press Enter.  Switch to this new directory...
(javascript/css/html) Follow these steps to implement the following browser-based puzzle game: 1. Get a photo of...
(javascript/css/html) Follow these steps to implement the following browser-based puzzle game: 1. Get a photo of yourself and save it as an image file 2. Use a image-splitting program such as splitter.imageonline.co to break the image into 9 roughly equal parts (3 x 3). Save those files in a directory 3. Write Javascript that takes these nine images and randomly rearranges them in a 3 x 3 grid. 4. Each cell in the grid will also have a checkbox. 5....
48.    Zip Games purchases blank DVD disks onto which it copies its software for sale through...
48.    Zip Games purchases blank DVD disks onto which it copies its software for sale through its mail order operation. A disk costs Zip $ 0.60. Processing an order for more disks cost $25. Zip uses 120,000 disks annually, and the annual inventory holding cost is 25% of the cost per disk. The lead time is two weeks. SHOW WORK FOR EACH PLEASE Find the optimal order quantity. How many orders are placed annually? How frequently should orders be placed?...
JavaScript When the button is pressed, the application should prompt the user to enter a string...
JavaScript When the button is pressed, the application should prompt the user to enter a string or ‘***’ to quit, and then remove all instances of the following substring “erd” in the input string. Assume no spaces in the string. Make the entire string lowercase to start with. It should show the parsed string (with the words already removed) in the text area. The application should then again do the above, clearing out the text area before each iteration of...
1. By convention, how are configuration files separated from regular files? (NOTE: A practical effect of...
1. By convention, how are configuration files separated from regular files? (NOTE: A practical effect of the separation is that they are not displayed by the default version of the ls command)                         a. the prefix "rc" (rc.filename)               c. the extension .cfig                         b. a dot (.) at the beginning                    d. by having the SUID bit set 2. The IP address which is reserved for local loopback (equivalent to "localhost") is:                         a. 255.255.255.0                                   c. 192.168.70.1...
15.4 Zip code and population (class templates) Complete the TODOs in StatePair.h and main.cpp. StatePair.h Define...
15.4 Zip code and population (class templates) Complete the TODOs in StatePair.h and main.cpp. StatePair.h Define a class StatePair with two template types (T1 and T2), and constructor, mutators, accessors, and PrintInfo() member functions which will work correctly with main.cpp. Note, the three vectors (shown below) have been pre-filled with StatePair data in main() and do not require modification. vector<StatePair <int, string>> zipCodeState: ZIP code - state abbreviation pairs vector<StatePair<string, string>> abbrevState: state abbreviation - state name pairs vector<StatePair<string, int>>...
You work for a credit bureau and have access to all of their records. You have...
You work for a credit bureau and have access to all of their records. You have been asked to estimate the percentage of Kentucky citizens who carry at least $1000 in credit card debt from month to month. To simplify your estimation process, you decide that you will randomly select several zip codes and examine all consumers listed under each of those zip codes. There are 945 zip codes in the Kentucky, and the population of the state is approximately...
Page 302 Minicase Jack Tar, CFO of Sheetbend & Halyard Inc., opened the internal company confidential...
Page 302 Minicase Jack Tar, CFO of Sheetbend & Halyard Inc., opened the internal company confidential envelope. It contained a draft of a competitive bid for a contract to supply duffel canvas to the U.S. Navy. The cover memo from Sheetbend’s CEO asked Mr. Tar to review the bid before it was submitted. The bid and its supporting documents had been prepared by Sheetbend’s sales staff. It called for Sheetbend to supply 100,000 yards of duffel canvas per year for...
PART B- Javascript Using a text editor (VS Code or Notepad) and a web browser, you...
PART B- Javascript Using a text editor (VS Code or Notepad) and a web browser, you will demonstrate how to create an HTML file, externally link a JavaScript file, and write some source code in the JavaScript file. a..Create two blank files to be an HTML file and a JavaScript file. The file names should be partA.html and partA.js. b.. Create a basic HTML webpage structure. c..Link the JavaScript file to the HTML file using the <script> tag. d.. Prompt...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT