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 🙏

© 2026 – Pkg Stats / Ryan Hefner

matrixlab.ts

v1.0.5

Published

A TypeScript matrix math library

Readme

ladunjexa GitHub license Deploy
Status npm version matrixlab Maintained PRs Welcome

matrixlab.ts is a matrix math library written in TypeScript with no dependencies.

How to install it

Using npm

npm install --save matrixlab.ts

Or add the unpkg cdn link to your html

<script src="https://unpkg.com/matrixlab.ts">

Usage

Import the module, from TypeScript or ES6 JavaScript

import { Matrix } from "matrixlab.ts";

The library is built as an ECMAScript module (.mjs file), but it also exports a UMD version if needed.

Then use the methods as you want

const m1 = new Matrix(2, 2, [
  [1, 2],
  [3, 4],
]);
m1.multiply(2);
// ==>
// Matrix {
//   rows: 2,
//   cols: 2,
//   values: [ [ 2, 4 ], [ 6, 8 ] ]
// }
m1.set(0, 0, 5);
m1.at(0, 0); // ==> 5

Documentation

Constructor

| constructor | description | | --------------------------- | ---------------------------------------------------------------------------- | | Matrix() | Creates a 1x1 matrix with zero value | | Matrix(n) | Creates an nxn matrix with zeroes | | Matrix(data) | Creates a matrix from the specified 2D array | | Matrix(rows, columns) | Creates an mxn matrix with zeroes | | Matrix(rows, columns, data) | Creates a matrix from the specified 2D array (with the specified dimensions) | | Matrix(n, data) | Creates an nxn matrix from the specified 2D array |

Accessors and Mutators

| member | description | | ------- | --------------------------------------------- | | rows | Retrieves the number of rows in the matrix | | columns | Retrieves the number of columns in the matrix | | data | Gets the data of the matrix |

Public Methods

| method | description | | ------------------------- | ---------------------------------------------------------------------- | | shape | Gets the shape of the matrix | | size | Gets the size of the matrix | | set(row, column, value) | Sets the value at the specified row and column indices | | at(row, column) | Retrieves the value at the specified row and column indices | | reset() | Sets all matrix values to 0 | | clone() | Returns a new instance of the matrix | | setData(array) | Copies data from the specified 2D array to the matrix | | add(matrix) | Adds the specified matrix to the current matrix | | subtract(matrix) | Subtracts the specified matrix from the current matrix | | multiply(Matrix / Scalar) | Multiplies the current matrix by the specified matrix or scalar | | modulo(modulus) | Modulos the current matrix by the specified modulus | | isSquare() | Checks if the matrix is square | | isSymmetric() | Checks if the matrix is symmetric | | isIdentity() | Checks if the matrix is identity | | setShape(array) | Sets the shape of the matrix | | setAsIdentity() | Sets the matrix as an identity matrix | | transpose() | Transposes the matrix | | determinant() | Calculates the determinant of the matrix | | getCofactor(row, column) | Calculates the cofactor of the matrix for the specified row and column | | getMinor(row, column) | Calculates the minor of the matrix for the specified row and column | | trace() | Calculates the trace of the matrix | | inverse() | Calculates the inverse of the matrix | | rowSpace() | Calculates the row space of the matrix | | colSpace() | Calculates the column space of the matrix | | isSameOrder(matrix) | Checks if the matrix has the same order as the specified matrix | | equals() | Checks if the matrix is equal to the specified matrix |

Private Methods

| method | description | | ------------------------- | ----------------------------------------------------------------------------- | | _isOutOfMatrix(row, col) | Checks if the specified row and column indices are out of the matrix's bounds | | _initializeMatrix() | Initializes the matrix with the specified dimensions and data |

For more information, please refer to the Matrix Class documentation

Contributing

Contributions are always welcome!

See contributing.md for ways to get started.

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

The MatrixLab is open source and distributed under the MIT License.

Contact

If you want to contact me, you can reach me at @ladunjexa.