plexidev-paste
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

plexidev-paste

An API wrapper for https://paste.plexidev.org

Basic Example

const paste = require("plexidev-paste");

// Create paste
const post = await paste.post("console.log('Hello World')", {
    language: "js",
    title: "Example Paste",
});

console.log(post);
/* -> {
  id: 'dHhCc8Vn8D',
  key: 'bYC2C11dNt7WRDC',
  raw: 'https://paste-api.plexidev.org/paste/dHhCc8Vn8D',
  url: 'https://paste.plexidev.org/dHhCc8Vn8D.js'
} */

// Get paste
const get = await paste.get(post.id);

console.log(get);
/* -> {
  id: 'dHhCc8Vn8D',
  createdAt: '2022-03-26T19:30:27.112Z',
  updatedAt: '2022-03-26T19:30:27.113Z',
  title: 'Example Paste',
  content: 'console.log('Hello World')',
  views: 1,
  size: 12
} */

Usage

.post(content, options)

Property Required? Default
content Yes null
options No {}
options.title No "Untitled Paste"
options.language No "js"

.get(id)

Property Required? Default
id Yes null

Package Sidebar

Install

npm i plexidev-paste

Weekly Downloads

0

Version

1.0.4

License

MIT

Unpacked Size

4.91 kB

Total Files

7

Last publish

Collaborators

  • truexpixels