npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

wqisland-island

v4.6.0

Published

island

Downloads

20

Readme

围棋岛

研究模式

this.resourceObj &&  this.resourceObj.off()
this.resourceObj = new Resource({
  $el: this.$refs.resource, // 必填,canvas对象
  sz: 13, // 必填,棋盘大小
  width: 500, // 必填,棋盘宽和高度,建议style写的多大就是多大
  content: sgf, // 必填, sgf 文件
  enableMouseOver: true, //  可填,是否开启鼠标移动效果,针对于pc端
  enableTouch: false, // 可填,是否开启移动端点击事件
  onError (e) {   // 必填,这道题做错事件
    console.log(e)
  },
  onDeadStones (stones, type) { // 选填,当前提子,提子类型  1 黑子 -1 白子
    console.log(stones, type)
  }
})
this.resourceObj.goFirstStep()  第一步
this.resourceObj.goStep(-1) 上一步
this.resourceObj.goStep(1) 下一步
this.resourceObj.goLastStep() 最后一步

打谱模式

this.score && this.score.off()
this.score = new Score({
  $el: [this.$refs.score1, this.$refs.score2], //必填,2个canvas对象
  sz: 13, // 必填,棋盘大小
  width: 500,  // 必填,棋盘宽和高度,建议style写的多大就是多大
  content: sgf, // 必填, sgf 文件
  enableMouseOver: true, //  可填,是否开启鼠标移动效果,针对于pc端
  enableTouch: false, // 可填,是否开启移动端点击事件
  onError (e) {  // 必填,这道题做错事件
    console.log(e)
  },
  onSuccess ({code, message}) { // 必填,做成功事件
    console.log(code, message)
  },
  onDeadStones (stones, type) { // 选填,当前提子,提子类型  1 黑子 -1 白子
    console.log(stones, type)
  },
  complete: () => {  // 必填,题目准备完成事件,需要主动调用start开始这道题
    console.log('准备完成')
    // 准备完成之后,主动触发游戏
    this.score.start()
  },
  ETLaZi: () => { // 机器落子事件
    console.log('机器落子')
  }
})

练习模式

this.practice && this.practice.off()
this.practice = new Practice({
  $el: this.$refs.practice, // 必填,canvas对象
  sz: 13, // 必填,棋盘大小
  width: 500, // 必填,棋盘宽和高度,建议style写的多大就是多大
  type: type, // 必填,题目类型 0 执行题 1 单选题 2 判断题 3 棋子笑脸题 4 棋子外点击三角符号题
  content: sgf, // 必填, sgf 文件
  enableTouch: false, // 可填,是否开启移动端点击事件
  onError (e) {  // 必填,这道题做错事件
    console.log(e)
  },
  onSuccess ({code, message}) { // 必填,做成功事件,有些题目需要自己去拿this.practice里面内容去判断是否正常,比如单选题
    this.practice.getSelected() // 获取选中棋子
    console.log(code, message)
  },
})

吃子 本地逻辑 (只有普通吃子)

this.manMachine && this.manMachine.off()
this.manMachine = new ManMachine({
  $el: this.$refs.manMachine, // 必填,canvas对象
  sz: 9,  // 必填,棋盘大小
  width: 500, // 必填,棋盘宽和高度,建议style写的多大就是多大
  whoBefore: 'et', // 必填,谁先下棋,用户先 传user,机器先传et
  level: 4, // 必填,1-5, 数字越大,机器越强
  stones: 5, // 必填,吃多少子算赢
  enableMouseOver: true, //  可填,是否开启鼠标移动效果,针对于pc端
  enableTouch: false, // 可填,是否开启移动端点击事件
  userChess: (point) => {   // 可填,用户是否需要确认落子,需要确认的话,开启此方法
    console.log(point)
    setTimeout(() => {
      this.manMachine.submit()  // 用户确认落子事件,交给用户自由发挥
    }, 3000)
  },
  etWant (type) {     // 可填,机器正在下子事件
    // type wanting 正在思考  wanted 思考完成,已下
    console.log(type)
  },
  onError (e) {  // 必填,暴露一些错误或者提示,比如不允许下子或者其他一些业务逻辑不允许情况
    console.log(e)
  },
  onSuccess (isWin, stones, level, sgf) {   // 必填,true代表人赢,false代表机器赢, 'flat'代表平局(现在逻辑是大于60手就平局)
    console.log(isWin, stones, level, sgf)
  },
  onKillStone (user_num, bt_num) {    // 必填,吃子数量回调(用户被吃子,人机被吃子)
    console.log(user_num, bt_num)
  },
})

吃子 外部接口 (包含花式吃子和普通吃子,只有9路和13路才有花式吃子,其他路没有数据)

this.manMachineHs &&  this.manMachineHs.off()
this.manMachineHs = new ManMachineHs({
  $el: this.$refs.manMachineHs, // 必填,canvas对象
  sz: 13,  // 必填,棋盘大小
  width: 500, // 必填,棋盘宽和高度,建议style写的多大就是多大
  whoBefore: 'et',  // 必填,谁先下棋,用户先 传user,机器先传et
  hs: true,  // 可填,是否花式围地,可以手动控制是否需要花式处理
  level: 25, // 必填,可传 5,7,8,9,10,15,20,25 数字越小,难度越大
  stones: 9, // 必填,吃多少子算赢(一般根据棋盘大小来,9路盘吃9子,13路盘吃9子)
  enableMouseOver: true,  //可填, 是否开启鼠标移动效果,针对于pc端
  enableTouch: false,    // 可填,是否开启移动端点击事件
  userChess: (point) => {   // 可填,用户是否需要确认落子,需要确认的话,开启此方法
    console.log(point)
    setTimeout(() => {
      this.manMachine.submit()  // 用户确认落子事件,交给用户自由发挥
    }, 3000)
  },
  etWant (type) {     // 可填,机器正在下子事件
    // type wanting 正在思考  wanted 思考完成,已下
    console.log(type)
  },
  onError (e) {  // 必填,暴露一些错误或者提示,比如不允许下子或者其他一些业务逻辑不允许情况
    console.log(e)
  },
  onSuccess (isWin, stones, level, sgf) {   // 必填,true代表人赢,false代表机器赢, 'flat'代表平局(现在逻辑是大于60手就平局)
    console.log(isWin, stones, level, sgf)
  },
  onKillStone (user_num, bt_num) {    // 必填,吃子数量回调(用户被吃子,人机被吃子)
    console.log(user_num, bt_num)
  },
})

围地 外部接口(包含花式围地和普通围地,只有13路才有花式围地,其他路没有数据)

this.manMachineWd &&  this.manMachineWd.off() // 建议每次off一下,释放内存
this.manMachineWd = new ManMachineWd({
  $el: this.$refs.manMachineWd,  // 必填,canvas对象
  sz: 13, // 必填,棋盘大小
  width: 500,  // 必填,棋盘宽和高度,建议style写的多大就是多大
  whoBefore: 'user',  // 必填,谁先下棋,用户先 传user,机器先传et
  hs: true, // 可填,是否花式围地,可以手动控制是否需要花式处理
  level: 25, // 必填,可传 5,7,8,9,10,15,20,25 数字越小,难度越大
  enableMouseOver: true,  //可填, 是否开启鼠标移动效果,针对于pc端
  enableTouch: false,    // 可填,是否开启移动端点击事件
  userChess: (point) => {   // 可填,用户是否需要确认落子,需要确认的话,开启此方法
    console.log(point)
    setTimeout(() => {
      this.manMachine.submit()  // 用户确认落子事件,交给用户自由发挥
    }, 3000)
  },
  etWant (type) {     // 可填,机器正在下子事件
    // type wanting 正在思考  wanted 思考完成,已下
    console.log(type)
  },
  onError (e) {  // 必填,暴露一些错误或者提示,比如不允许下子或者其他一些业务逻辑不允许情况
    console.log(e)
  },
  onSuccess (isWin, stones, level, sgf) {   // 必填,true代表人赢,false代表机器赢, 'flat'代表平局, 'shuzi'代表进入数子阶段,业务主动调用suzi的方法,得到返回结果显示到页面上
    console.log(isWin, stones, level, sgf)
  },
  onKillStone (user_num, bt_num) {    // 必填,吃子数量回调(用户被吃子,人机被吃子)
    console.log(user_num, bt_num)
  },
})