Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

4chan-boards

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

4chan-boards

Get a board's name and type given its short name (eg. `/b/`).

  • 2.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
18
increased by350%
Maintainers
1
Weekly downloads
 
Created
Source

4chan-boards

Get a board's name and type given its short name (eg. /b/).

2.0.0 BREAKING CHANGES

Enumerated types are now Symbols, so relying on falsy evaluation will no longer work:

const boards = require('4chan-boards')

if (boards.getType('b')) {
  console.log('This will not print!')
}

Instead, use the provided enumerated types:

if (boards.getType('b') !== boards.INVALID) {
  console.log('This message prints! Yay!')
}

Installation

yarn add 4chan-boards

# OR

npm install --save 4chan-boards

Usage

const boards = require('4chan-boards')

console.log(boards.getName('wsg'))                // Worksafe GIF
console.log(boards.getType('b') === boards.NSFW)  // true

API

Methods

Get information (ie name or type) about a board.

  • boards.getName(board)
  • boards.getType(board)

Objects

Objects mapping short names to full names. boards.all contains the mapping for all the boards, boards.sfw contains mapping for only the SFW boards, etc.

  • boards.all
  • boards.admin
  • boards.nsfw
  • boards.sfw

Enumerated types

boards.getType(board) will return an enumerated type, which has been implemented as a Symbol

  • boards.ADMIN
  • boards.NSFW
  • boards.SFW
  • boards.INVALID

FAQs

Package last updated on 20 Jan 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc