Exciting release!Introducing "safe npm". Learn more
Socket
Log inDemoInstall

paste.gg

Package Overview
Dependencies
1
Maintainers
1
Versions
6
Issues
File Explorer

Advanced tools

paste.gg

An easy-to-use library for interacting with the Paste.GG API. Contains examples, strong JSDocs, TypeScript types, and support for Node.js 12+. Works in both JavaScript and TypeScript.

    1.0.5latest
    GitHub

Version published
Maintainers
1
Weekly downloads
689
decreased by-1.85%

Weekly downloads

Changelog

Source

v1.0.5

Version 1.0.5 has been released! This update brings the following:

  • Update node-fetch to 2.6.7 to fix a vulnerability issue (https://security.snyk.io/vuln/SNYK-JS-NODEFETCH-2342118)

Readme

Source

paste.gg

NPM version NPM downloads Build status GitHub code size

A library for interacting with the Paste.GG API. I have created this in a short amount of time and will expect more updates in the future. The main purpose of this is to help users from having to create API calls.

API Documentation
GitHub
NPM

Usages

Install the stable version
npm install paste.gg yarn add paste.gg
Install the beta version (git is required)
npm install SerenModz21/paste.gg#beta yarn add SerenModz21/paste.gg#beta
Get started with paste.gg
const PasteGG = require("paste.gg"); // or import PasteGG from "paste.gg"; // If you want to be anonymous const pasteGG = new PasteGG() // If you want to use an api key const pasteGG = new PasteGG("apiKeyHere")
Get information about a post
// if you would like to exclude file contents await pasteGG.get("idHere") // If you would like to include file contents await pasteGG.get("idHere", true)
Post a new paste (Click here for more options)
await pasteGG.post({ name: "Paste name", // Optional description: "Paste description", // Optional expires: "2020-12-21T02:25:56.428Z", // Optional (must be a UTC ISO 8601 string) files: [{ name: "file.txt", // Optional content: { format: "text", value: "This is where the file content will go" } }] })
Delete a paste (auth/deletion key needed)
// Delete with deletion key await pasteGG.delete("idHere", "deletionKeyHere") // Delete with auth key if not set in constructor await pasteGG.delete("idHere", "authKeyHere") // Leave blank if auth key is in the class constructor await pasteGG.delete("idHere")
Update the post
await pasteGG.update("idHere", { name: "new name", // Optional (if you want to remove the name) description: "new description" })

Contributions are more than welcome. If you would like to add to this API, you can open a pull request as I haven't added everything on the API, only the things that will get used more often.

Copyright © SerenModz21 2018 - 2021

Keywords

FAQs

Last updated on 23 Jan 2022

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket
support@socket.devSocket SOC 2 Logo

Product

  • Package Issues
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc