Browse Source

🎉 Initial commit

master
KaKi87 1 month ago
commit
a0b2a49997
1 changed files with 17 additions and 0 deletions
  1. +17
    -0
      mod.js

+ 17
- 0
mod.js View File

@ -0,0 +1,17 @@
/**
* @function isSubreddit
* @param {string} subreddit - Subreddit name (without "r/")
* @returns {Promise<boolean>}
*/
const isSubreddit = async subreddit => {
const {
status
} = await fetch(`https://reddit.com/r/${subreddit}`, {
method: 'HEAD'
});
return status === 200 || status === 403;
};
export {
isSubreddit
}

Loading…
Cancel
Save