
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
An API wrapper for SnipBin, written in TypeScript.
SnipBin is also written by me -- be sure to check it out and leave a ⭐ if you enjoyed the concept!
# install snipbin.js@latest
yarn add snipbin.js
# or...
# npm install snipbin.js
Set your SnipBin API key to use restricted features of this API.
Note: You don't have to be authenticated to use this library or SnipBin's API.
import { authorize } from 'snipbin.js'
authorize('myApiKey')
Note: You can't fetch encrypted snips.
import { snipbin } from 'snipbin.js'
snipbin.getSnip('abt')
Note: In order to link a snip with your account, make sure to set authorize with your API key.
import { snipbin, authorize } from 'snipbin.js'
authorize('myApiKey')
snipbin.createSnip({
slug: 'test-snip',
content: "import { snipbin } from 'snipbin.js'",
language: 'js',
// password: 'secret'
})
Note: Since you can only edit snips on your account, you must set authorize with your API key.
import { snipbin, authorize } from 'snipbin.js'
authorize('myApiKey')
snipbin.editSnip('test-snip', {
slug: 'test-snip2',
content: "we're editing this thing, whoa!",
// password: 'secret'
})
Note: Since you can only delete snips on your account, you must set authorize with your API key. Also, it goes without saying that this action is irreversible.
import { snipbin, authorize } from 'snipbin.js'
authorize('myApiKey')
snipbin.deleteSnip('test-snip')
Note: This is simply a wrapper around LangMyst, which uses go-enry to detect languages.
import { detect } from 'snipbin.js'
detect.detectLanguage({ snippet: "import { snipbin } from 'snipbin.js'" })
Aside from that, the codebase is also fully documented. If you prefer, you can go through the codebase to better find your way around this project with the different return types and functions.
Additionally, you can find the different endpoints and internals of this API over on SnipBin's API documentation
After setting up the project, and making changes:
git add .
git commit -m "commit message"
git push YOUR_REPO_URL YOUR_BRANCH
Since I haven't written a proper API wrapper before, a big round of thanks to Ian Hornik for writing pastemyst.ts, as this library is built around it.
FAQs
⚡ A TypeScript API wrapper for SnipBin
We found that snipbin.js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.