satyajit_med_downloader
v1.0.5
Published
satyajit_med_downloader is a versatile Node.js package that simplifies downloading media files such as images, videos, and PDFs from the web. With customizable templates and an easy-to-use API, it's ideal for sending transactional emails and managing emai
Downloads
6
Readme
satyajit_med_downloader
Media file downloader - a complete solution to download images,videos,PDFS and audio file hassle free
Installation
You can install the Satyajit Media Downloader package via npm. Run the following command in your terminal:
npm install satyajit_med_downloader
downloadFile is a function who takes two argument
downloadFile("url","location to download the files")
Important
"type": "module"
will cause . js files to be interpreted as ES modules. so make sure you have added this line to your package.json
file
How to use
- to download the image
import { downloadFile } from 'satyajit_med_downloader';
// Example: Download an image
downloadFile('https://example.com/image.jpg', './image')
.then(() => console.log('Image downloaded successfully'))
.catch((error) => console.error('Error downloading image:', error));
- to download the video
// Example: Download a video
import { downloadFile } from 'satyajit_med_downloader';
downloadFile('https://example.com/video.mp4', './video')
.then(() => console.log('Video downloaded successfully'))
.catch((error) => console.error('Error downloading video:', error));
- to download the PDF
// Example: Download a PDF
import { downloadFile } from 'satyajit_med_downloader';
downloadFile('https://example.com/document.pdf', './document')
.then(() => console.log('PDF downloaded successfully'))
.catch((error) => console.error('Error downloading PDF:', error));