1.0.5 • Published 4 years ago

dontpad-api v1.0.5

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

dontpad-api

An unofficial API to read and write content to www.dontpad.com

Requirements

  • NodeJS

Installation

npm install --save dontpad-api

Usage

  • Import the api to your file
const dontpad = require('dontpad-api');

Functions

writeContent(dontPad, text): Write the specified text to the specified dontpad url.

readContent(dontPad): Retrieves the content of the specified dontpad url.

Sample

Writing and Reading content to a dontpad url

const dontpad = require('dontpad-api');

const dontPadTarget = 'testdontpad';

dontpad.writeContent(dontPadTarget, 'This is a test ')
    .then(response => {
        console.log('Saved succesfully...');
        
        dontpad.readContent(dontPadTarget)
            .then(conteudo => {
                console.log("Reading dontpad content... ");
                console.log('Content: ', conteudo);
                console.log('Check the content in http://dontpad.com/' + dontPadTarget);
            }).catch(err => {
                console.log('Error reading dontpad ', err)  
            });
    })
    .catch(err => {
        console.log('Error saving dontpad ', err);
    })
1.0.5

4 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago