Have ideas to improve npm?Join in the discussion! »

    @aistglobal/chessboard

    1.0.10 • Public • Published

    Chess Board

    npm version GitHub issues GitHub stars GitHub license Mozilla Add-on

    Simple chess board used api from chess.js and chessboard.js include new
    functionality custom handling envents and custom promotion
    
    • example implementation
     var config = {
           ...
            //same chessboard.js configurations
        };
        var ex1Board = new BoardChess('board',config);

    methods

    • get fen
    ex1Board.fen
    • get game
    ex1Board.game
    • get board
    ex1Board.board
    • get pgn
    ex1Board.pgn
    • get move
    ex1Board.move
    • set position
    ex1Board.position('position string like fen')
    • mixins(triggers)

    - on dragStart

    ex1Board.on('dragStart',cb => {
    //...
    })
    //es5
    ex1Board.on('dragStart',function(){
    //...
    })

    - on drop

    ex1Board.on('drop',cb => {
    //...
    })
    //es5
    ex1Board.on('drop',function(){
    //...
    })

    - on drop

    ex1Board.on('snapEnd',cb => {
    //...
    })
    //es5
    ex1Board.on('snapEnd',function(){
    //...
    })

    - on update

    ex1Board.on('update',cb => {
    //...
    })
    //es5
    ex1Board.on('update',function(){
    //...
    })

    Cancel the subscription, usage handler

    ex1Board.off('update',cb => {
    //...
    })
    //es5
    ex1Board.off('update',function(){
    //...
    })

    Chess Board

    Simple chess board used api from chess.js and chessboard.js include new
    functionality custom handling envents and custom promotion
    
    • example implementation
     var config = {
           ...
            //same chessboard.js configurations
        };
        var ex1Board = new BoardChess('board',config);

    methods

    • get fen
    ex1Board.fen
    • get game
    ex1Board.game
    • get board
    ex1Board.board
    • get pgn
    ex1Board.pgn
    • get move
    ex1Board.move
    • set position
    ex1Board.position('position string like fen')
    • mixins(triggers)

    - on dragStart

    ex1Board.on('dragStart',cb => {
    //...
    })
    //es5
    ex1Board.on('dragStart',function(){
    //...
    })

    - on drop

    ex1Board.on('drop',cb => {
    //...
    })
    //es5
    ex1Board.on('drop',function(){
    //...
    })

    - on drop

    ex1Board.on('snapEnd',cb => {
    //...
    })
    //es5
    ex1Board.on('snapEnd',function(){
    //...
    })

    - on update

    ex1Board.on('update',cb => {
    //...
    })
    //es5
    ex1Board.on('update',function(){
    //...
    })

    Cancel the subscription, usage handler

    ex1Board.off('update',cb => {
    //...
    })
    //es5
    ex1Board.off('update',function(){
    //...
    })

    Install

    npm i @aistglobal/chessboard

    DownloadsWeekly Downloads

    4

    Version

    1.0.10

    License

    MIT

    Unpacked Size

    120 kB

    Total Files

    6

    Last publish

    Collaborators

    • avatar