Skip to content

Development-Code/Sourcebin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sourcebin

Fast and simple package to get and create bins from sourcebin

Requirements

NodeJS >= 10.x

Install

npm install sourcebin

Setup

Node JS

const sourcebin = require('sourcebin');

TypeScript

import { get, create, url } from 'sourcebin';

For es imports such as the TypeScript import it's recommened you only import the methods you need

Get a bin

sourcebin.get(key or url, options)

const bin = await sourcebin.get('qXO2NVhRc6');

Options:

fetchContent - whether to fetch bin content or not (default true)

Create a bin

sourcebin.create([ files ], options)

const bin = await sourcebin.create(
    [
        {
            content: 'Hello World',
            language: 'text',
        },
    ],
    {
        title: 'bin name',
        description: 'test bin',
    },
);

Files

name - file name
content - file content (required)
language - language or language id (default text)

Options

title - bin title
description - bin description

Other Methods

  • Url

    sourcebin.url(key or url)

    const { url, short } = url('qXO2NVhRc6');

FAQ

  • Multiple files in one bin

    This is not currently possible with this wrapper as sourcebin doesn't have a token system for authentication, only pro users are able to have multiple files in one bin. This may come in the future

Support

  • Message me on discord: GHOST#7524
  • Join the discord
  • Create a issue on the github

About

Fast and simple package to get and create bins from https://sourceb.in/

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%