@cordxapp/pastes
v0.4.18
Published
Official module for posting code snippets, text and more to our bin
Downloads
2
Readme
CordX Pastes
Simple module for posting and fetching code snippets, text and more to/from our bin.
Documentation
Install
npm install @cordxapp/pastes
Imports
Commonjs
const { PasteClient } = require('@cordxapp/pastes');
ES6
import { PasteClient } from '@cordxapp/pastes';
New paste
import {PasteClient} from '@cordxapp/pastes'
const pastes = new PasteClient();
await pastes.post('Some text sting or whatever you want here!')
.then((r) => {
console.log(r);
}).catch((e) => {
console.log(e.stack)
});
Get paste
import {PasteClient} from '@cordxapp/pastes'
const pastes = new PasteClient();
await pastes.get('PASTE_KEY/ID_HERE')
.then((r) => {
console.log(r.data);
}).catch((e) => {
console.log(e.stack)
});
Get raw
import {PasteClient} from '@cordxapp/pastes'
const pastes = new PasteClient();
await pastes.raw('PASTE_KEY/ID_HERE')
.then((r) => {
console.log(r.code);
}).catch((e) => {
console.log(e.stack)
});