1.0.22 • Published 11 months ago

classic-url-uploader v1.0.22

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

URL Uploader

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

prerequisites

  • Your file should be CSV or Excel
  • The file should have a url column

Example of the file: example.csv

Nourlother colums...
1https://www.example1.com
2https://www.example2.com
3https://www.example1.com
4https://www.example3.com
5https://www.example1.com
6https://www.example3.com

Installation

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

Usage in your project

import { UrlUploadProcessor } from "classic-url-uploader";

In your controller of somewhere you need to use the Package

const result = await UrlUploadProcessor.uploadMultipleUrls(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 data in CSV or EXCEL file with no duplicated data
{
  status: 200,
  message: 'File processed successfully',
  data: [
    { url: 'https://www.example1.com' },
    { url: 'https://www.example2.com' }
  ],
  duplicatedWebsites: []
}
2. Read data in CSV or EXCEL file with duplicated urls data
{
  status: 200,
  message: 'File processed successfully',
  data: [
    { url: 'https://www.example1.com' },
    { url: 'https://www.example2.com' }
  ],
  duplicatedWebsites: [
    { url: 'https://www.example1.com' },
    { url: 'https://www.example1.com' },
    { url: 'https://www.example1.com' }
  ]
}
1.0.22

11 months ago

1.0.21

11 months ago

1.0.20

11 months ago

1.0.19

11 months ago

1.0.18

11 months ago

1.0.17

11 months ago

1.0.16

11 months ago

1.0.15

11 months ago

1.0.14

11 months ago

1.0.13

11 months ago

1.0.12

11 months ago

1.0.11

11 months ago

1.0.10

11 months ago

1.0.9

11 months ago

1.0.8

11 months ago

1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago