Skip to content
This repository was archived by the owner on Nov 4, 2019. It is now read-only.

Latest commit

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Weeb Wrapper npm versionDownloads

A simple, yet useful wrapper for the weeb.sh API.


Installing the Module

Yarn

yarn add weeb-wrapper

NPM

npm install weeb-wrapper

Usage

Disclaimer: This is just a simple wrapper, if you want more information than url, type, fileType, etc... You should not be even downloading a node module for that.

On this examples WeebWrapper will be:
constWeebWrapper=require('weeb-wrapper');

Random

constwrapper=newWeebWrapper(<Token>);
wrapper.random(<ImageType/ImageTag>, {hidden,nsfw,filetype}); // Returns Promise<Object>
/**
* You can get the ImageTypes and ImageTags using the wrapper.types(); and wrapper.tags();
* Everything on the object of the second argument is optional.
*/

Example:

constwrapper=newWeebWrapper(<Token>);
wrapper.random('hug', {hidden: false,nsfw: false,filetype: 'jpeg'});

Tags

constwrapper=newWeebWrapper(<Token>);
wrapper.tags(hidden); // Returns Promise<Array<string>>/** * The first and only argument is optional. */

Example:

constwrapper=newWeebWrapper(<Token>);
wrapper.tags(false);

Types

constwrapper=newWeebWrapper(<Token>);
wrapper.types(hidden); // Returns Promise<Array<string>>/** * The first and only argument is optional. */

Example:

constwrapper=newWeebWrapper(<Token>);
wrapper.types(true);

Upload

constwrapper=newWeebWrapper(<Token>);
wrapper.upload(<Buffer>, <ImageType/ImageTag>, {nsfw,source,tags}); // Returns Promise<Object>
/**
* The third argument is optional.
* The first argument is a File Buffer, for example using https://nodejs.org/api/fs.html#fs_fs_readfile_path_options_callback
*/

Example:

constwrapper=newWeebWrapper(<Token>);
wrapper.upload('<directory>', 'hug', {nsfw: true,source: '<URL/Anime Name>',tags: 'cuddle,astolfo'});

About

A NPM Module for the Weeb API (https://weeb.sh)

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages