2.0.0 • Published 10 months ago

pastefy v2.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
10 months ago

pastefy

pastefy is an API-Wrapper for Pastefy.app.

image

Install the package📥

npm install pastefy

Functions📚

Pastes📄

Create 📝

import Pastefy from "pastefy";
const pastefy = new Pastefy("API_KEY");

const result = await pastefy.paste.create("Title", "Content", options);
console.log(result);
Output
{
  success: true,
  paste: {
    exists: true,
    id: 'iXUlzofQ',
    content: 'Pastefy',
    title: 'Test',
    encrypted: false,
    visibility: 'UNLISTED',
    raw_url: 'https://pastefy.app/iXUlzofQ/raw',
    type: 'PASTE',
    created_at: '2023-07-04 18:16:19.35'
  }
}

Get 🔎

import Pastefy from "pastefy";
const pastefy = new Pastefy("API_KEY");

const result = await pastefy.paste.get("iXUlzofQ");
console.log(result);
Output
{
  exists: true,
  id: 'iXUlzofQ',
  content: 'Pastefy',
  title: 'Test',
  encrypted: false,
  visibility: 'UNLISTED',
  raw_url: 'https://pastefy.app/iXUlzofQ/raw',
  type: 'PASTE',
  created_at: '2023-07-04 18:16:19.0'
}

Edit ✏️

import Pastefy from "pastefy";
const pastefy = new Pastefy("API_KEY");

const result = await pastefy.paste.edit("iXUlzofQ", "New Content", options);
console.log(result);

Output

{ success: true }

Delete 🗑️

import Pastefy from "pastefy";
const pastefy = new Pastefy("API_KEY");

const result = await pastefy.paste.delete("iXUlzofQ");
console.log(result);

Output

{ success: true }

Folders📁

Create 📝

import Pastefy from "pastefy";
const pastefy = new Pastefy("API_KEY");

const result = await pastefy.folder.create("Title");
console.log(result);

Output

{
  success: true,
  folder: {
    exists: true,
    id: 'sr7Wcntu',
    name: 'Test',
    user_id: 'KSdtLPTK',
    children: [],
    pastes: [],
    created: '2023-07-04 18:34:53.722'
  }
}

Get 🔎

import Pastefy from "pastefy";
const pastefy = new Pastefy("API_KEY");

const result = await pastefy.folder.get("sr7Wcntu");
console.log(result);

Output

{
  exists: true,
  id: 'sr7Wcntu',
  name: 'Test',
  user_id: 'KSdtLPTK',
  children: [],
  pastes: [
    {
      exists: true,
      id: 'TEiOgP7k',
      content: 'console.log("Hello World");',
      title: 'Test Paste',
      encrypted: false,
      folder: 'sr7Wcntu',
      user_id: 'KSdtLPTK',
      visibility: 'UNLISTED',
      raw_url: 'https://pastefy.app/TEiOgP7k/raw',
      type: 'PASTE',
      created_at: '2023-07-04 18:35:58.0'
    }
  ],
  created: '2023-07-04 18:34:53.0'
}

Edit ✏️

import Pastefy from "pastefy";
const pastefy = new Pastefy("API_KEY");

const result = await pastefy.folder.edit("sr7Wcntu", "New Title");
console.log(result);

Output

{ success: true }

Delete 🗑️

import Pastefy from "pastefy";
const pastefy = new Pastefy("API_KEY");

const result = await pastefy.folder.delete("sr7Wcntu");
console.log(result);

Output

{ success: true }
2.0.0

10 months ago

1.3.2

2 years ago

1.3.1

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago