Skip to content

DonovanDMC/E621

Repository files navigation

E621

The most comprehensive wrapper for e621 you'll ever find.

We support almost anything normal users can do, with plans to bring everything else in, and more later in development.

See the Features List for all of the things this module supports, and what is planned.

This module is not officially supported or endorsed by any of the e621 staff. Do not go to them if something does not work.


This module is structured with submodules corresponding to separate areas of the site. All of these modules are on the primary class, which can be constructed like so:

import E621 from "e621"; // or const E621 = require("e621");

// no options are required, see below for the options
const e621 = new E621();

// the options are all an object in the first parameter, e.g.
const e621 = new E621({
	authUser: "",
	authKey:  ""
});

// all of the available modules stem from this main class,
// e.g. use e621.posts.METHOD(), e621.users.METHOD()

Options

Most of these options shouldn't be used unless you know what you're doing (you probably only need authUser and authKey, and you can set userAgent)

Option Type Default Description
authUser String None User for authentication
authKey String None Token for authentication
userAgent String See Code UserAgent for requests

Instance Options

These are set via the setInstance function.

Option Type Default Description
reconstructStaticURL See Code See Code Override default url reconstruction
imageReconstructionType "e621" | "yiffy" | "local" | null See Code See Code
ssl Boolean 1 See Code
port Number 1 See Code
host String 1 See Code

Using YiffyAPI or E621 Dev?

We've got built in classes for both. E621 dev assumes you're using e621ng@ce871e4 or later, as they changed where the dev site is accessed in this commit. you can use the built in sub-classes E621.YiffyAPI E621.Dev to access these, and for anything else: there's E621.Custom

import E621 from "e621"; // or import { YiffyAPI, Dev, Custom } from "e621";

// first and only parameter is Options
const yapi = new E621.Yiffy();
const dev = new E621.Dev();
// first parameter is Options, second is InstanceOptions
const custom = new E621.Custom({}, {
	host: "example.com",
	port: 443,
	ssl: true
});

Footnotes

  1. This is very dependent on where this function is used. If used on a subclass, like Yiffy or Dev the defaults will be set to something else, but otherwise they are: true, 443, e621.net 2 3

About

A module for fetching posts from e621.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published