0.3.0 • Published 1 year ago

pixhost v0.3.0

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Introduction

Node.Js implementation of Pixhost.to API.

Installation

# cd /your/project/directory
# npm install pixhost --save

Usage

Image upload:

import * as pixhost from 'pixhost'

const response = await pixhost.uploadImage('/path/to/assets/image.jpg')
console.log(response)

Cover upload:

import * as pixhost from 'pixhost'

const response = await pixhost.uploadCover(['/path/to/assets/cover_left.jpg', '/path/to/assets/cover_right.jpg'])
console.log(response)

Galleries

import { uploadImage, createGallery, finalizeGallery } from './index.js'

const gallery = await createGallery('test')
const output = await uploadImage('/Users/deadtoto/Downloads/giphy.gif', gallery.gallery_upload_hash, gallery.gallery_hash)
const finalyzedGallery = await finalizeGallery(gallery.gallery_upload_hash, gallery.gallery_hash)

console.log(gallery)
console.log(output)
console.log(finalyzedGallery)