Helper package to handle requests to a jschan api instance.

Overview

jschan-api-sdk

Helper package to handle requests to a jschan api instance.

How to use

npm install ussaohelcim/jschan-api-sdk

const { jschan } = require('jschan-api-sdk')
const api = new jschan.api("https://fatchan.org")
import { jschan } from "jschan-api-sdk";
const api = new jschan.api("https://ptchan.org")
const sdk = new jschan.api("https://ptchan.org")
const post = {
	message:"Hello.",
	thread:0,
}
sdk.postThread("br",post)//Promise<Number(200)>
//Reply the thread 0 from "br", with the message "Hello."
const sdk = new jschan.api("https://ptchan.org")
const post = {
	message:"Hello, /br/!.",
	thread:null,
	file: createReadStream("image.jpg")
}
sdk.postThread("br",post)//Promise<Number(200)>
//Creates a new thread with the image
const sdk = new jschan.api("https://ptchan.org")

sdk.getOverboardCatalog({
	include_default:false,
	add:"br,cyb"
}).then((res)=>{
	console.log(res)
})

sdk.getBoardList({
	direction:'asc',
	search:"hue",
	sort:'popularity'
}).then((res)=>{
	console.log(res)
})

sdk.getBoardPage('br',10).then((res)=>{
	console.log(res)
})

sdk.getBoardPage('br').then((res)=>{
	console.log(res)
})

sdk.getOverboardIndex().then((res)=>{
	console.log(res)
})

Custom stuff

There is also a custom library in development.

import {jschan} from "jschan-api-sdk"
import {custom} from "jschan-api-sdk/custom"

const pt = new jschan.api("https://ptchan.org")

pt.getThread("i",0).then((t)=>{
	let ct = custom.Thread(t)
	let filenames = ct.getAllFiles().map((f)=>{
		return pt.getFilesPath() + f.filename
	})
	
	console.log(filenames)
	/**
	 * ["https://ptchan.org/file/12345abcde.jpg",
	 * "https://ptchan.org/file/12345abcde.mp4",
	 * "https://ptchan.org/file/12345abcde.webm"]
	 */
})
You might also like...

A Discord.JS Command Handler to handle commands eaiser

TABLE OF CONTENTS Installation Setup Changing Default Prefix Creating a Command Usage of minArgs and maxArgs Syntax Errors Global Syntax Errors Per Co

Jun 8, 2022

Handle errors like it's 2022 🔮

Handle errors like it's 2022 🔮 Error handling framework that is minimalist yet featureful. Features Minimalist API Custom error types Wrap any error'

Jan 7, 2023

Small TS library to type and safely handle `serde` JSON serializations of Rust enums.

rustie-ts TypeScript library with helper types and functions to type-safely handle Rust's serde JSON serialization of Enums. It can also be used stand

Jul 17, 2022

This is just a script I put together to check and notify me via email (MailGun) when there's an earlier date before my initial appointment date. It doesn't handle rescheduling.

This is just a script I put together to check and notify me via email (MailGun) when there's an earlier date before my initial appointment date. It doesn't handle rescheduling.

US-visa-appointment-notifier This is just a script I put together to check and notify me via email (MailGun) when there's an earlier date before my in

Jan 4, 2023

🍣 CLI to handle Private Git Submodules in your Vercel Project

🍣 CLI to handle Private Git Submodules in your Vercel Project

vercel-submodules: The CLI to handle Private Git Submodules in your Vercel Project This project is community-driven and not affiliated with Vercel in

Jan 1, 2023

Angular JWT refresh token with Interceptor, handle token expiration in Angular 14 - Refresh token before expiration example

Angular JWT refresh token with Interceptor, handle token expiration in Angular 14 - Refresh token before expiration example

Angular 14 JWT Refresh Token example with Http Interceptor Implementing Angular 14 Refresh Token before Expiration with Http Interceptor and JWT. You

Nov 30, 2022

A simple handle tap and hold action for Svelte/SvelteKit.

Svelte Tap Hold Minimalistic tap and hold component for Svelte/SvelteKit, see demo here. Installation // Using Yarn to install yarn add --dev svelte-t

Dec 8, 2022

ish.ninja is a free online platform to allocate a unique ish.ninja sub handle name for a BlueSky account.

ish.ninja ish.ninja is a free online platform to allocate a unique ish.ninja sub handle name for a BlueSky account. It is built using Next.js, Xata, T

May 9, 2023

A peroidic-table api built with Nodejs & Mongodb to help make frontend requests dealing with chemistry...

A peroidic-table api for frontend apps Usage Example (GET all elements) // GET /api/elements const ajio = require("ajio") ajio.baseUrl("https://apis-

May 24, 2022
Owner
Michell
Yet another traveler.
Michell
Um bot de suporte feito usando threads para o Discord, 100% customizável, feito em JavaScript e inspirado no Rio Helper do servidor Elixir Lab e na Loritta Helper do serivdor de suporte da Loritta.

Ticket Bot Um bot de suporte feito usando threads para o Discord, 100% customizável, feito em JavaScript e inspirado no Rio Helper do servidor Elixir

ADG 6 Dec 21, 2022
Deno app to serve gmi pages on-the-fly for a gemini instance of my portfolio & blog

Aries Deno app to serve gmi pages on-the-fly for a gemini instance of my portfolio & blog Usage In order to run locally, you'll need SSL certs. You ca

Maxim 2 Jun 13, 2022
A small helper package for discord.js users

helper-djs Helper Djs is a powerful Node.js module Features Error Handler Auto Meme Requirement node v16.14 Installation npm install helper-djs Bot Se

Aadhu 4 Aug 9, 2022
The easiest way to animate your Next.js project. Scrollreveal.js helper package.

next-reveal The easiest way to animate your Next.js app Demo Introduction next-reveal makes it easy to add awesome scroll animations to your Next.js p

Zoltan Fodor 8 Nov 25, 2022
Package fetcher is a bot messenger which gather npm packages by uploading either a json file (package.json) or a picture representing package.json. To continue...

package-fetcher Ce projet contient un boilerplate pour un bot messenger et l'executable Windows ngrok qui va permettre de créer un tunnel https pour c

AILI Fida Aliotti Christino 2 Mar 29, 2022
An itty library to handle common time-related things for your API needs.

Tiny (~500 bytes) time math library for making date handling and TTLs within your APIs beautiful. Features Tiny @ ~500 bytes gzipped total, and tree-s

Kevin R. Whitley 8 Jan 2, 2023
Zero dependencies, lightweight, and asynchronous https requests package.

This project is a Work in Progress and currently in development. The API is subject to change without warning. A small fetching package for super simp

Ray Arayilakath 11 Dec 8, 2022
Example CRUD API for API Fest'22. See Pull Requests for chapter 2 and 3

Example CRUD API for API Fest'22. See Pull Requests for chapter 2 and 3

Postman Student Program 6 Mar 2, 2022
Some process handle JavaScript function parameter.

Function parameter handle or paremeter error control Example 1: Just checking if all arguments were passed / defined. const required = (name) => {

Md. Nazmul Islam 4 Mar 14, 2022