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 🙏

© 2024 – Pkg Stats / Ryan Hefner

justreact-advanced

v1.1.1-beta.0.0.5

Published

It is combo of loading elements

Downloads

295

Readme

justreact-advanced

justreact-advanced is an npm package designed to facilitate the downloading and saving of various types of files including CSV, ZIP, images, Excel, and PDF files. It provides a straightforward and efficient way to handle file downloads in React applications.

Features

  • Download: Download CSV files by passing an encoded string.
  • ZipSave: Save files in a ZIP format.
  • ImageSave: Save images.
  • StrToByte: Convert strings to byte arrays.
  • Excel: Save and download Excel files.
  • PDF: Save and download PDF files.

Installation

To install the package, run:

npm install justreact-advanced
yarn add justreact-advanced


Usage

Download CSV

To download a CSV file, pass the encoded string to the Download function.

Download

import { fileSave } from "justreact-advanced";

// Example CSV data encoded as a string
const csvData = "data:text/csv;charset=utf-8,Name,Age\nJohn,30\nJane,25";

fileSave((type = "csv"), csvData, "example.csv");

prop

type:"csv"| "excel" | "pdf" | "zip" | "image"

API

Download(encodedString, fileName) encodedString (string): The encoded string to download. fileName (string): The name of the file to save. ZipSave(files, fileName) files (Array): An array of objects with name and content properties. fileName (string): The name of the ZIP file to save. ImageSave(imageUrl, fileName) imageUrl (string): The URL of the image to save. fileName (string): The name of the image file to save. StrToByte(str) str (string): The string to convert to a byte array. Excel(data, fileName) data (Array): The data to include in the Excel file. fileName (string): The name of the Excel file to save. PDF(content, fileName) content (string): The HTML content to include in the PDF file. fileName (string): The name of the PDF file to save. License This project is licensed under the MIT License.

Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

Acknowledgements

Special thanks to the contributors and the open-source community for their support.

Contact

For any questions or feedback, please reach out at [email protected].

Enjoy using justreact-advanced!