npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

vamtec-react

v1.0.1

Published

Vamtec is a file generation (PDF, Excel, CSV), image uploads handling and automation library

Downloads

27

Maintainers

my-universemy-universe

Keywords

image-uploadfile-uploadupload-modulefile-managementdirectory-handlermulterexpress-file-uploadfile-storageupload-directoryfile-systemmulter-storageupload-configfile-handlernodejs-uploadfile-upload-handlerexpress-multerfile-upload-serverupload-servicenode-uploadimage-file-uploadtimestamp-filenameoriginal-filenameupload-utilityupload-apifile-upload-apiexpress-uploaddynamic-file-uploadfile-storage-systemfile-directoryupload-directory-creatorfile-saverupload-setupfile-destinationnodejs-storageimage-file-handlerimage-upload-servicefile-organizationfile-saver-nodejsfile-name-handlerupload-optionsupload-folderfile-typenodejs-image-uploadfile-organization-apicustom-file-uploadupload-folder-creatornodejs-file-uploadupload-storage-systemupload-handlerfile-storage-nodefile-directory-managementupload-configurationfile-handler-nodejsexpress-file-handlerupload-file-managerfile-upload-solutionvamtecexpressdynamic-installserver-starternpm-packageexpress-serverexpress-utilitynpm-automationdynamic-setupweb-servernodejsserver-managernpm-deployexpress-toolsauto-installexpress-helpernpm-utilitybackendserverinstallation-toolexpress-setupnpm-package-toolutility-toolwebexpress-managerexpress-scriptsserver-setupserver-utilitynodejs-toolsnodejs-serverexpress-autoautomation-toolnpm-scriptsbackend-toolsexpressjsinstall-dependencyexpress-automationweb-developmentdeveloper-toolsexpress-helper-packagewebserver-packageserver-starter-packagedependency-managernpm-managernode-expressexpress-server-packagenpm-deployment-toolsexpress-startupnodejs-helperweb-server-tools

Readme

# vamtec-react

`vamtec-react` is a React utility library designed to simplify common frontend tasks, such as file downloading, handling different file formats, and more.

## Installation

To install the library, you can use either `npm` or `yarn`:

### npm:
```bash
npm install vamtec-react

yarn:

yarn add vamtec-react

Usage

Downloading Files

The library provides a simple utility for triggering file downloads from a given data source.

import { DownloadFile } from 'vamtec-react';

const handleDownload = (data, fileName, fileExtension) => {
  DownloadFile(fileName, fileExtension, data);
};

Example: Downloading Leave Requests

Here’s an example using axios to download leave requests in different formats such as Excel, CSV, or PDF.

import React, { useState } from 'react';
import axios from 'axios';
import { DownloadFile } from 'vamtec-react';

const App = () => {
  const [fileFormat, setFileFormat] = useState("excel"); // Default to 'excel' without the dot

  const handleDownload = async () => {
    try {
      const response = await axios.get(`http://localhost:5000/download-leave-requests?format=${fileFormat}`, { responseType: 'blob' });
      // Map 'excel', 'csv', 'pdf' to their respective extensions
      const fileExtension = fileFormat === "excel" ? ".xlsx" : fileFormat === "csv" ? ".csv" : ".pdf";
      // Call the fileHandling function with correct file name and extension
      DownloadFile('Download', fileExtension, response.data); // Pass base filename, extension, and data
    } catch (error) {
      console.error('Error downloading file', error);
    }
  };

  return (
    <div>
      <h1 className="text-2xl font-bold mb-4">Download Leave Requests</h1>
      <select value={fileFormat} onChange={(e) => setFileFormat(e.target.value)} className="p-2 border rounded-md w-full mb-4">
        <option value="excel">Excel (.xlsx)</option>
        <option value="csv">CSV (.csv)</option>
        <option value="pdf">PDF (.pdf)</option>
      </select>
      <button onClick={handleDownload} className="bg-blue-500 text-white p-2 rounded mt-4">
        Download Leave Requests
      </button>
    </div>
  );
};

export default App;

API

DownloadFile(baseFilename, fileExtension, data)

  • baseFilename (string): The base name of the file (without the extension).
  • fileExtension (string): The file extension (e.g., .xlsx, .csv, .pdf).
  • data (Blob): The data to be downloaded.

This function creates a temporary anchor (<a>) element, sets the download attribute with the provided baseFilename and fileExtension, and triggers a download of the file using the data provided.

Example:

If you're downloading leave request data as an Excel file, the function will use the filename 'Download', append the .xlsx extension, and download the file using the Blob data.

DownloadFile('Download', '.xlsx', response.data);

Contributing

We welcome contributions to improve this library! If you'd like to contribute, please:

  1. Fork the repository.
  2. Create a feature branch (git checkout -b feature-branch).
  3. Commit your changes (git commit -am 'Add new feature').
  4. Push to the branch (git push origin feature-branch).
  5. Open a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

This library is maintained by Sivasaran S.


### Key Sections in `README.md`:
1. **Installation**: Instructions for installing the library with `npm` or `yarn`.
2. **Usage**: Basic usage showing how to import and use the `DownloadFile` utility function.
3. **Example**: A full example using `axios` to download leave requests as different file formats (Excel, CSV, PDF).
4. **API Documentation**: A brief explanation of how the `DownloadFile` function works.
5. **Contributing**: Instructions on how to contribute to the project.
6. **License**: MIT License information.
7. **Author**: Maintainer's details (you).

This `README.md` provides clear usage instructions for developers integrating the `vamtec-react` library into their React projects. Let me know if you need any more details or adjustments!