{"id":16226164,"url":"https://github.com/ghostdevv/sourcebin","last_synced_at":"2025-03-19T13:30:29.388Z","repository":{"id":39582313,"uuid":"258862607","full_name":"ghostdevv/sourcebin","owner":"ghostdevv","description":"Fast and simple package to get and create bins from https://sourceb.in/","archived":false,"fork":false,"pushed_at":"2024-01-10T05:47:42.000Z","size":752,"stargazers_count":12,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-09T00:05:54.796Z","etag":null,"topics":["discord","hacktoberfest","language","sourcebin","sourcebin-api","sourcebin-wrapper","sourcebinapi","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ghostdevv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"ghostdevv","patreon":"onlyspaceghost","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":"https://ghostdev.xyz/donate"}},"created_at":"2020-04-25T20:00:02.000Z","updated_at":"2025-03-07T11:10:38.000Z","dependencies_parsed_at":"2024-06-18T17:07:23.562Z","dependency_job_id":"ab3befd5-ee93-48b5-a22c-d9b2c4bf7e0b","html_url":"https://github.com/ghostdevv/sourcebin","commit_stats":{"total_commits":151,"total_committers":5,"mean_commits":30.2,"dds":0.152317880794702,"last_synced_commit":"611318be1b4aff17d19f80df20b73908ddf53376"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostdevv%2Fsourcebin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostdevv%2Fsourcebin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostdevv%2Fsourcebin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ghostdevv%2Fsourcebin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ghostdevv","download_url":"https://codeload.github.com/ghostdevv/sourcebin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243806918,"owners_count":20350921,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["discord","hacktoberfest","language","sourcebin","sourcebin-api","sourcebin-wrapper","sourcebinapi","typescript"],"created_at":"2024-10-10T12:48:18.867Z","updated_at":"2025-03-19T13:30:29.108Z","avatar_url":"https://github.com/ghostdevv.png","language":"TypeScript","readme":"# Sourcebin\n\n[![](https://img.shields.io/npm/v/sourcebin?label=Latest%20Version\u0026style=for-the-badge\u0026logo=npm\u0026color=informational)](https://www.npmjs.com/package/sourcebin)\n[![](https://img.shields.io/static/v1?label=Project%20Creator\u0026message=GHOST\u0026color=informational\u0026style=for-the-badge)](https://ghostdev.xyz)\n[![](https://img.shields.io/github/workflow/status/ghostdevv/sourcebin/Test%20Suite%20CI?style=for-the-badge)](https://github.com/ghostdevv/sourcebin)\n\nFast and simple package to get and create bins from [sourcebin](https://sourceb.in/)\n\n# Requirements\n\n```\nNodeJS \u003e= 14.x\n```\n\n# Install\n\n```\nnpm install sourcebin\n```\n\n# Docs\n\nThis README is the best place to learn how to use this package, you can also [take a look at our API docs](https://ghostdevv.github.io/sourcebin/index.html)\n\n# Setup\n\n```js\n// Import individual methods\nimport { create, get, url } from 'sourcebin';\n\n// Import all methods\nimport * as sourcebin from 'sourcebin';\n\n// Use required\nconst { create, get, url } = require('sourcebin');\n```\n\n# Get a bin\n\n`get(options)`\n\n```js\nconst bin = await get({\n    key: 'qXO2NVhRc6'\n});\n```\n\n## Options\n\n| Option         | Description                       | Default | Required |\n|----------------|-----------------------------------|---------|----------|\n| `key`          | The key to get                    | n/a     | ✅       |\n| `fetchContent` | Should the bin content be fetched | `true`  | ❌       |\n\n# Create a bin\n\n`create(options)`\n\n```js\nconst bin = await create(\n    {\n        title: 'bin name',\n        description: 'test bin',\n        files: [\n            {\n                content: 'Hello World',\n                language: 'text',\n            },\n        ],\n    },\n);\n```\n\n## Options\n\n| Option         | Description            | Required |\n|----------------|------------------------|----------|\n| `title`        | Title of the bin       | ❌       |\n| `description`  | Description of the bin | ❌       |\n| `files`        | Bin files - see below  | ✅       |\n\n### File Options\n\n| Option         | Description                      | Default | Required |\n|----------------|----------------------------------|---------|----------|\n| `content`      | Contents of the file             | n/a     | ✅       |\n| `language`     | What language should the file be | `text`  | ❌       |\n\n# Url Helper\n\nIf you want to get information about a bin try the `url` function.\n\n```js\nconst urlData = url('iQznILdZRP');\n\n// or\n\nconst urlData = url('https://sourceb.in/iQznILdZRP');\n```\n\nThis returns an object that looks like:\n\n```js\n{\n  key: 'iQznILdZRP',\n  url: 'https://sourceb.in/iQznILdZRP',\n  short: 'http://srcb.in/iQznILdZRP'\n}\n```\n\n# FAQ\n\n-   ## Multiple files in one bin\n\n    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\n\n-   ## Migrate from v4 to v5\n\n    v5 is a overhaull of `sourcebin` so we changed some apis.\n\n    ### Get a bin\n\n    Instead of passing the `key` then `options` it's now one object.\n\n    ```diff\n    - const bin = await get('qXO2NVhRc6');\n    + const bin = await get({ key: 'qXO2NVhRc6' });\n\n    - const bin = await get('qXO2NVhRc6', { fetchContent: false });\n    + const bin = await get({ key: 'qXO2NVhRc6', fetchContent: false });\n    ```\n\n    ### Create a bin\n\n    We also unified the options for this function:\n    \n    ```diff\n    - const bin = await create(\n    -    [\n    -        {\n    -            content: 'Hello World',\n    -            language: 'text',\n    -        },\n    -    ],\n    -    {\n    -        title: 'bin name',\n    -        description: 'test bin',\n    -    },\n    - );\n\n    + const bin = await create(\n    +   {\n    +       title: 'bin name',\n    +       description: 'test bin',\n    +       files: [\n    +           {\n    +               content: 'Hello World',\n    +               language: 'text',\n    +           },\n    +       ],\n    +   }\n    +  );\n    ```\n\n# Support\n\n-   Join the [discord](https://discord.gg/2Vd4wAjJnm)\n-   Create a issue on the [github](https://github.com/ghostdevv/sourcebin)\n","funding_links":["https://github.com/sponsors/ghostdevv","https://patreon.com/onlyspaceghost","https://ghostdev.xyz/donate"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghostdevv%2Fsourcebin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghostdevv%2Fsourcebin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghostdevv%2Fsourcebin/lists"}