![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
dir-uploader
Advanced tools
An uploader module to upload all files in a directory or to upload files of a type. It sends a multipart request to the endpoint with all files attached to it
Description: This is a npm module to upload all files in a directory or to upload files of a specific type to a rest end point using multipart request. If you just pass in a file instead of directory then it will just upload the given file. If there are multiple files in a directory it sends one multipart request attaching all the files to it. Please see the configuration section for the option details
It is dependent on the following node modules
One way is to keep dir-uploader
as a dependency in your package.json
pointing to its current repo
npm install dir-uploader --save-dev
To update to the latest version
npm update dir-uploader
The following are the configurable options using command npm run send-data
url: The URL of REST end point where we post the files
result-path: the folder or file that need to be posted
metadata-file: meta data file that need to be posted
export-file-type: file type you want uploaded or true for all files in directory
delete-files: do we want to delete folder files after successfully sending the files
You can use it using a commandline or inside another JS file as an import.
From Command line you can either use send-data npm task or directly call export function sendData
Using send-data npm task:
npm run send-data -- url='http://localhost:3020/post' result-path='tests/e2e/sample-exports/browser-based-results' metadata-file='tests/e2e/sample-exports/test.json' export-xml-only=true delete-files=false
Using js exported function sendData:
node -e 'require("./dir-uploader").sendData("http://localhost:3020/post","tests/e2e/sample-exports/browser-based-results","tests/e2e/sample-exports/test.json",false,true)'
You can also find an example of how to use module in the tests folder "runTests.js" file. These are e2e tests for this module.
This module includes a tests folder that contains a simple node test app, unit tests and end to end(e2e) tests. The tests runner is mocha (https://mochajs.org/). To run the tests
npm install
.npm i -g mocha
node tests/testapp/server.js
(tested on node v10).mocha tests/runTests.js
This module includes logging using the winston node js plugin. If you need to lower the logging level from error for any reason you can change the logging level inside the dir-uploader.js file.
We are actively using this module as a component in our Continuous Integration Cycle and we don't have any open issue. Please contact us if you run into any issues.
You can contact any of us if you run into any issues
We needed this module to export our test results to a rest end point so we wrote it. We have tried to make it general with the configurable options as possible. Please let us know if you have any suggestions. We thank you to "Philips Health Solutions" in general to give us opportunity to write this plugin.
FAQs
An uploader module to upload all files in a directory or to upload files of a type. It sends a multipart request to the endpoint with all files attached to it
The npm package dir-uploader receives a total of 4 weekly downloads. As such, dir-uploader popularity was classified as not popular.
We found that dir-uploader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.