New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

node-upload-images

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-upload-images

Library for uploading images to popular image hosting services, uses Node and Axios.

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
13K
-8.54%
Maintainers
1
Weekly downloads
 
Created
Source

node-upload-images

Library for uploading images to popular image hosting services, uses Node and Axios.

  • Upload from binary, file and remote URL

Supported services

  • new.fastpic.org
  • pixhost.to
  • postimages.org
  • upload.cc - DDoS Guard protection bypassed using axios-ddos-guard-bypass

Installation

npm install node-upload-images

Usage

Upload from binary data:

import { ImageUploadService } from 'node-upload-images';
import * as fs from 'fs';

const service = new ImageUploadService('new.fastpic.org');

try {
  const imageData = fs.readFileSync('/test.png');
  let { directLink } = await service.uploadFromBinary(imageData, 'test.png');

  console.log(directLink);
} catch (error) {}

Upload from file:

import { ImageUploadService } from 'node-upload-images';

const service = new ImageUploadService('new.fastpic.org');

try {
  let { directLink } = await service.uploadFromUrl('./test.png');

  console.log(directLink);
} catch (error) {}

Upload from remote URL:

import { ImageUploadService } from 'node-upload-images';

const service = new ImageUploadService('new.fastpic.org');

try {
  let { directLink } = await service.uploadFromUrl(
    'https://example.com/image.png'
  );

  console.log(directLink);
} catch (error) {}

Limitations

No login/authentication support yet, image upload is anonymous.

Keywords

image

FAQs

Package last updated on 07 Aug 2023

Did you know?

Socket

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