2.2.0 • Published 10 months ago

@falloutstudios/sourcebin.js v2.2.0

Weekly downloads
-
License
GPL-3.0
Repository
-
Last release
10 months ago

Sourcebin.js

A simple https://sourceb.in api library

Installation

npm i @falloutstudios/sourcebin.js
yarn add @falloutstudios/sourcebin.js
pnpm add @falloutstudios/sourcebin.js

Simple usage

const { create, get, LanguageType } = require('@falloutstudios/sourcebin.js'); // Use import for ES Modules

create({
    title: 'My Bin',
    files: [
        {
            name: 'hello.js',
            content: 'console.log("hello, world!");',
            languageId: LanguageType.Javascript
        }
    ]
})
.then(async ({ key }) => {
    const data = await get(key); // Gets the bin data
})

Usage with account

Warning Automating account actions is against the sourcebin terms. We are not responsible for your account in case of termination.

To get your token, login to https://sourceb.in, open the dev panel in your browser, find the applications tab, go to cookies, then copy the value of access_token.

npm.io

const { Client, LanguageType } = require('@falloutstudios/sourcebin.js'); // Use import for ES Modules

const client = new Client({
    token: 'acess_token'
});

client.createBin({
    title: 'My Bin',
    files: [
        {
            name: 'hello.js',
            content: 'console.log("hello, world!");',
            languageId: LanguageType.Javascript
        }
    ]
}).then(async bin => {
    await bin.delete(); // Deletes the created bin
});
2.2.0

10 months ago

2.1.0

11 months ago

2.0.3

12 months ago

2.0.2

12 months ago

2.0.1

12 months ago

2.0.0

12 months ago

1.1.3

12 months ago

1.1.2

12 months ago

1.1.1

12 months ago

1.1.0

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago