
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
simple-matrix-js
Advanced tools
一个用于数独和棋类游戏的简单矩阵操作库。
npm install simple-matrix
import { SimpleMatrix } from 'simple-matrix';
// 创建一个矩阵(支持空值配置)
const matrix = new SimpleMatrix([
[1, 2, 3],
[4, 5, 6],
[7, 8, 9]
], { emptyValue: 0 }); // 配置空值为 0
// 基本操作
const row = matrix.getRow(0); // 获取第0行
const col = matrix.getCol(1); // 获取第1列
const around = matrix.getRound([1, 1]); // 获取周围8个元素
const subGrid = matrix.getSubGrid([1, 1], 3); // 获取3x3宫格
// 斜线操作(五子棋场景)
const diagonal = matrix.getDiagonalBidirectional([2, 2], 2, 2); // 左上2格+右下2格
// 值操作
matrix.setValue([0, 0], 10); // 设置值
matrix.clearValue([0, 0]); // 清空值(自动使用 emptyValue: 0)
// 批量操作
matrix.forEach((val, x, y) => console.log(val, x, y));
const doubled = matrix.map(v => v * 2);
const evens = matrix.filter(v => v % 2 === 0);
// 查找和统计
const found = matrix.find(v => v > 5);
const count = matrix.countValue(5); // 统计值为5的元素数量
// 行列修改
matrix.insertRow(1, [10, 11, 12]);
matrix.deleteRow(0);
matrix.insertCol(1, [20, 21, 22]);
matrix.deleteCol(0);
// 拷贝操作
const cloned = matrix.clone(); // 深拷贝
const array = matrix.toArray(); // 导出为数组
详细 API 文档:https://www.yuque.com/leeyamaster/simple-matrix.js/
本地文档:查看 doc/API.md 和 doc/demo.html
MIT
FAQs
A simple matrix library for sudoku and board games
The npm package simple-matrix-js receives a total of 6 weekly downloads. As such, simple-matrix-js popularity was classified as not popular.
We found that simple-matrix-js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.