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

classic-file-uploader

v1.0.2

Published

A fastest Node.js package for processing uploaded CSV or Excel files.

Downloads

159

Readme

CSV/EXcel File Uploader

A fastest Node.js package for processing uploaded CSV or Excel files.

Prerequisites

  • Your file should be CSV or Excel
  • The file must have columns

Example of the file: example.csv

| No | url | ID | Owner | | --- | --- | --- | --- | | 1 | https://www.example1.com | RHA58 | Dom58 | | 2 | https://www.example2.com | RHA59 | Dom | | 3 | https://www.example1.com | RHA60 | Dom58 | | 4 | https://www.example3.com | RHA61 | Dom58 | | 5 | https://www.example1.com | RHA62 | Dom58 | | 6 | https://www.example3.com | RHA63 | Dom |

Installation

npm install classic-file-uploader
pnpm add classic-file-uploader
yarn add classic-file-uploader

Usage in your project

import { FileUploadProcessor } from "classic-file-uploader";

In your controller of somewhere you need to use the Package

const result = await FileUploadProcessor.uploadCsvExcelFile(request as Request)
console.log(result);

Result should be error or data in the file

Sample of the result

Errors

1. When the file is not CSV or Excel file
{
  status: 400,
  error: 'Unsupported file type, file should be CSV/Excel'
}
2. When there is an Internal server error
{
  status: 500,
  error: 'Internal server error'
}

Data response

1. Read all data in CSV or EXCEL file
{
  status: 200,
  message: 'File processed successfully',
   data: [
    { No: 1, url: 'http://example.com', Id: 58 },
    { No: 2, url: 'http://example2.com', Id: 59 },
    { No: 3, url: 'http://example3.com', Id: 60 },
    { No: 4, url: 'http://example4.com', Id: 61 },
    { No: 5, url: 'http://example5.com', Id: 62 },
    { No: 6, url: 'http://example6.com', Id: 63 },
    { No: 7, url: 'http://example.com', Id: 64 },
    { No: 8, url: 'http://example2.com', Id: 65 },
    { No: 9, url: 'http://example3.com', Id: 66 },
    { No: 10, url: 'http://example4.com', Id: 67 },
    { No: 11, url: 'http://example5.com', Id: 68 }
  ]
}