0.0.7 • Published 3 years ago

@acciosolutions/images v0.0.7

Weekly downloads
18
License
MIT
Repository
github
Last release
3 years ago

@acciosolutions/images

NPM Module

A library to upload images from NodeJS

The API of this library is inspired by https://imgur.com

Dependency Status

Install

Using npm

npm install --save @acciosolutions/images

Using yarn

yarn add @acciosolutions/images

Usage

You need import the AccioClient from library

import { AccioClient } from "@acciosolutions/images";
import AccioClient from "@acciosolutions/images";
const AccioClient = require("@acciosolutions/images");
const { AccioClient } = require("@acciosolutions/images");

You need setup the AccioClient with ClientID and ClientSecret

const client = new AccioClient({
  clientId: string;
  clientSecret: string;
})

Methods

AccioClient uploadFromPath()

Usage

const file = path.resolve(__dirname, "image.png");
const response: UploadResponse = await client.uploadFromPath(file);

Interfaces

interface UploadResponse {
  deleteHash: string;
  uuid: string;
  url: string;
  directUrl: string;
  createdAt: string;
  updatedAt: string;
}

License

@acciosolutions/images is released under the MIT license.

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago