ndarr
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

ndarr

ndarr is an experimental JavaScript library for numerical computing with N-dimensional arrays, inspired by NumPy.

The goal is to provide an intuitive API for matrix and array operations using TypedArray, enabling high-performance computing in JavaScript environments.

This project is currently in early development. Contributions, ideas, and discussions are welcome!


🚧 Project Status

Stage: Initial design and prototyping
Main focus: Internal architecture, np.array() constructor, shape/dtype inference.


📌 Planned Features

  • [ ] np.array(data) — construct arrays from nested JS arrays
  • [ ] np.zeros(shape) — create zero-filled arrays
  • [ ] np.ones(shape) — create one-filled arrays
  • [ ] NDArray.prototype.get(...indices) — access values
  • [ ] NDArray.prototype.set(...indices, value) — assign values
  • [ ] NDArray.prototype.reshape(newShape) — reshape arrays
  • [ ] NDArray.prototype.transpose() — transpose dimensions
  • [ ] np.dot(a, b) — matrix multiplication
  • [ ] Basic operations: add, sub, mul, div
  • [ ] Statistical ops: mean, sum, argmax, std
  • [ ] Broadcasting support
  • [ ] Slice/indexing: a[0:2, 1]
  • [ ] Dtype support: float64, float32, int32, uint8, ...

💡 Why?

JavaScript lacks a native high-performance numerical array system comparable to NumPy. This library explores how far we can go using native ArrayBuffer and TypedArray to support numerical operations, linear algebra, and eventually integration with ML/web systems.


📦 Installation (coming soon)

npm install ndarr

📄 License

MIT © Oleh Levchenko @leva13007

Package Sidebar

Install

npm i ndarr

Weekly Downloads

0

Version

0.0.2

License

MIT

Unpacked Size

4.09 kB

Total Files

7

Last publish

Collaborators

  • leva13007