JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 649
  • Score
    100M100P100Q96306F
  • License MIT

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

Package Exports

  • sourcebin

Readme

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