Socket
Socket
Sign inDemoInstall

@rafapaezbas/chess-cli

Package Overview
Dependencies
2
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @rafapaezbas/chess-cli

Javascript chess cli.


Version published
Weekly downloads
0
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Chess-cli

Javascript chess cli.

♟ ♜ ♞ ♝ ♛ ♚

chess board

npm install -g @rafapaezbas/chess-cli
chess-cli

How to play.

Control the cursor with arrows. Select piece with return key.

Api

const Chess = require('@rafapaezbas/chess-cli')
const chess = new Chess()

getPosition(fen = false)

const jsonPosition = chess.getPosition()
const fenPosition = chess.getPosition(true)

move({ src, dst })

chess.getPosition({ src:12, dst:28 }) // e4

moveIsLegal({ src, dst })

// inital position
const isLegal = chess.moveIsLegal({ src:12, dst:28 }) // true

start()

Starts key controls and rules of movements to cursor control.

chess.start()

FAQs

Last updated on 07 Nov 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc