Socket
Socket
Sign inDemoInstall

usegeneratecsv

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    usegeneratecsv

GenerateCSV is a versatile Node.js hook that simplifies the process of creating CSV (Comma-Separated Values) files from structured data. This hook empowers developers to effortlessly transform their data into CSV format, making it ideal for a wide range o


Version published
Maintainers
1
Created

Readme

Source

useGenerateCSV

useGenerateCSV is a JavaScript/TypeScript utility for generating CSV (Comma-Separated Values) files from data arrays. It is designed to simplify the process of creating CSV files for various use cases, such as data export, report generation, and data interchange.

Installation

You can install useGenerateCSV using npm or yarn:

npm install usegeneratecsv
# or
yarn add usegeneratecsv

Usage
To use useGenerateCSV, import it into your JavaScript or TypeScript project:
import useGenerateCSV from 'usegeneratecsv';

const data = [
  ['Name', 'Email'],
  ['Alice', 'alice@example.com'],
  ['Bob', 'bob@example.com'],
];

// Generate a CSV file and trigger a download
useGenerateCSV(data, 'mydata.csv');

Parameters
data (Array): An array of string arrays representing the data to be converted into CSV format.

fileName (String): The desired file name for the generated CSV file.

Example
Here's an example of using useGenerateCSV to create and trigger a CSV file download:
import useGenerateCSV from 'usegeneratecsv';

const data = [
  ['Name', 'Email'],
  ['Alice', 'alice@example.com'],
  ['Bob', 'bob@example.com'],
];

useGenerateCSV(data, 'mydata.csv');

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

Contributing
Contributions are welcome! If you have any bug fixes, improvements, or new features to propose, please open an issue or submit a pull request.

Issues
If you encounter any issues or have questions or suggestions, please feel free to open an issue.

Acknowledgments
This package was inspired by the need for a simple CSV generation utility.
Special thanks to the open-source community for their valuable contributions.
Author
Your Name
GitHub: github.com/yourusername

Replace `"usegeneratecsv"` and `"yourusername"` with the actual package name and your GitHub username or details as needed.

Keywords

FAQs

Last updated on 11 Sep 2023

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc