First, to be able to use the library, install it first using the following command:
npm install pastebin-scraper --saveThis library is a promise-based library, so you first must require it in your code and then import the function Scrape:
const {Scrape} = require('pastebin-scraper');
Scrape('https://pastebin.com/4Z489JeC')
.then(res => console.log(res))Output will be an object, which can be accessed using properties.
{
title: 'Pastebin Scraper',
views: '8',
rawData: 'This is for the Pastebin scraper Node.js library',
user: 'mrslurpyboi',
expiration: 'Never',
dateCreated: 'Aug 15th, 2021',
language: 'text'
}You can run this test this library in the tryit.js folder if you are, for example, running this library in GitHub or Replit.
v2.0.0
