You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fast and simple package to get and create bins from [sourcebin](https://sourceb.in/)
8
4
9
5
# Requirements
10
6
11
-
```
12
-
NodeJS >= 14.x
13
-
```
14
-
15
-
# Install
16
-
17
-
```
18
-
npm install sourcebin
19
-
```
20
-
21
-
# Docs
22
-
23
-
This 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)
24
-
25
-
# Setup
26
-
27
-
```js
28
-
// Import individual methods
29
-
import { create, get, url } from'sourcebin';
30
-
31
-
// Import all methods
32
-
import*assourcebinfrom'sourcebin';
33
-
34
-
// Use required
35
-
const { create, get, url } =require('sourcebin');
36
-
```
7
+
Node >= 22.13
37
8
38
9
# Get a bin
39
10
40
11
`get(options)`
41
12
42
13
```js
43
-
constbin=awaitget({
44
-
key:'qXO2NVhRc6',
45
-
});
14
+
import { get } from'sourcebin';
15
+
16
+
constbin=awaitget({ key:'qXO2NVhRc6'});
46
17
```
47
18
48
19
## Options
@@ -57,6 +28,8 @@ const bin = await get({
57
28
`create(options)`
58
29
59
30
```js
31
+
import { create } from'sourcebin';
32
+
60
33
constbin=awaitcreate({
61
34
title:'bin name',
62
35
description:'test bin',
@@ -112,55 +85,14 @@ This returns an object that looks like:
112
85
113
86
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
114
87
88
+
-## Migrate from v5 to v6
89
+
90
+
This was just a maintenance release and the API hasn't actually changed. You will need to use Node `>=22.13` or above, as we removed the dependency on axios in favour of [native `fetch`](https://nodejs.org/docs/latest-v22.x/api/globals.html#fetch). Additionally, this package is now esm only which shouldn't cause any problems thanks to [`require(esm)`](https://nodejs.org/docs/latest-v25.x/api/modules.html#loading-ecmascript-modules-using-require), but if you experience [any issues please open one](https://github.com/ghostdevv/sourcebin/issues/new).
91
+
115
92
-## Migrate from v4 to v5
116
93
117
-
v5 is a overhaull of `sourcebin` so we changed some apis.
118
-
119
-
### Get a bin
120
-
121
-
Instead of passing the `key` then `options` it's now one object.
122
-
123
-
```diff
124
-
- const bin = await get('qXO2NVhRc6');
125
-
+ const bin = await get({ key: 'qXO2NVhRc6' });
126
-
127
-
- const bin = await get('qXO2NVhRc6', { fetchContent: false });
[See the README from a v5 release](https://github.com/ghostdevv/sourcebin/blob/611318be1b4aff17d19f80df20b73908ddf53376/README.md#migrate-from-v4-to-v5)
162
95
163
96
# Support
164
97
165
-
- Join the [discord](https://discord.gg/2Vd4wAjJnm)
166
-
- Create a issue on the [github](https://github.com/ghostdevv/sourcebin)
98
+
- Create a issue on the [github](https://github.com/ghostdevv/sourcebin/issues/new)
0 commit comments