1.3.0 • Published 4 years ago

gfurjs v1.3.0

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

gfurjs

Retrieve gfur easily from a subreddit

Version 1.3.0 Release (06/22/2020)

  • Fixed http request errors for smoother & quicker output
  • Added request package notice
  • General bugfix

Installation

npm i gfurjs

Request package required

npm i request

Usage

To get the full JSON output:

const { gfur } = require('gfurjs');

gfur(function(err, data) {
  if (err) return console.error(err);
  console.log(data);
});

To filter subreddits:

const { gfur } = require('gfurjs');
 
gfur('crappydesign', function(err, data) {
  if (err) return console.error(err);
  console.log(data);
});

Async requests:

const { gfurAsync } = require('gfurjs');

gfurAsync() // Use gfurAsync('subredditname') to filter subreddits
.then(m => {
  // Do stuff with the JSON
  console.log(m);
})
.catch(e => {
  // Handle the error
  console.log(e);
})

TypeScript support:

import { gfurAsync } from 'gfurjs';

gfurAsync() // Use gfurAsync('subredditname') to filter subreddits
.then(m => {  
  // Do stuff with the JSON
  console.log(m);
})
.catch(e => {
  // Handle the error
  console.log(e);
});
1.3.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago