To set up the project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/gmadar/FileDownloader.git cd your-repo-name
-
Use node 18.x: If you have NVM installed, run:
nvm install
to install the correct version of node.
-
Install dependencies: Install project dependencies by running:
npm install
-
Run the development server: Start the development server to see your changes live:
npm run dev
-
Build the project: To create a production build, run:
npm run build
-
Run Storybook: To start Storybook and view the components in different scenarios
npm run storybook
-
Run tests: To run the tests, use:
npm run test
-
Preview the production build: To preview the production build locally, run:
npm run preview
This component allows you to download a file or a list of files from a URL.
the files are supplied in a json format as a list of objects with the following structure:
[
{
"name": "smss.exe",
"device": "Mario",
"path": "\\Device\\HarddiskVolume2\\Windows\\System32\\smss.exe",
"status": "scheduled"
},
{
"name": "netsh.exe",
"device": "Luigi",
"path": "\\Device\\HarddiskVolume2\\Windows\\System32\\netsh.exe",
"status": "available"
},
{
"name": "uxtheme.dll",
"device": "Peach",
"path": "\\Device\\HarddiskVolume1\\Windows\\System32\\uxtheme.dll",
"status": "available"
},
{
"name": "aries.sys",
"device": "Daisy",
"path": "\\Device\\HarddiskVolume1\\Windows\\System32\\aries.sys",
"status": "scheduled"
},
{
"name": "cryptbase.dll",
"device": "Yoshi",
"path": "\\Device\\HarddiskVolume1\\Windows\\System32\\cryptbase.dll",
"status": "scheduled"
},
{
"name": "7za.exe",
"device": "Toad",
"path": "\\Device\\HarddiskVolume1\\temp\\7za.exe",
"status": "scheduled"
}
]
To use this component, you need to provide json as an input prop to the component.
<FileDownloader files={files} />