A modular library for creating and manipulating multidimensional array views over 1D storage in JavaScript.
ndarray is a JavaScript library for creating and manipulating multidimensional array views over 1D data storage, such as typed arrays or standard Arrays. It solves the problem of performing efficient numerical computations, matrix operations, and image processing in JavaScript by providing constant-time slicing, transposition, and strided access without data duplication.
JavaScript developers working on scientific computing, data visualization, image processing, or numerical simulations who need efficient multidimensional array operations similar to those in numpy or MATLAB.
Developers choose ndarray for its modular design, performance optimizations like zero-copy views, and seamless integration with the scijs ecosystem, offering a lightweight yet powerful alternative to heavier numerical libraries.
📈 Multidimensional arrays for JavaScript
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Creates multidimensional views over 1D data storage like typed arrays without copying data, enabling memory-efficient operations for large datasets as highlighted in the README examples.
Performs slicing, transposition, and flipping in O(shape.length) time, allowing complex array transformations without performance hits, as documented in the API section.
Provides methods like .lo(), .hi(), and .step() for strided access and subarray views, making it easy to manipulate arrays with minimal overhead, as shown in the code snippets.
Part of the scijs ecosystem with many compatible modules for tasks like linear algebra and image processing, fostering modularity and extensibility per the README links.
Lacks built-in mathematical operations; users must integrate separate modules for common tasks like matrix multiplication, increasing dependency management complexity.
Requires understanding of low-level concepts like strides and offsets, which can be daunting for developers unfamiliar with numerical computing or array layouts.
The README is technical and assumes prior knowledge, with limited beginner-friendly tutorials or examples beyond basic usage, potentially hindering onboarding.
ndarray is an open-source alternative to the following products: