# matrix-transposer

> Transpose 2D array.

Latest version **0.10.1** (published 2016-09-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install matrix-transposer
pnpm add matrix-transposer
yarn add matrix-transposer
bun add matrix-transposer
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.10.1 |
| Published | 2016-09-30 |
| First published | 2016-09-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | jBellTree |
| Maintainers | jbelltree |
| Keywords | array, matrix, transpose |

## Links

- npm: https://www.npmjs.com/package/matrix-transposer
- npm.io page: https://npm.io/package/matrix-transposer

## Recent versions

- 0.10.1 (latest) — 2016-09-30
- 0.10.0 — 2016-09-27
- 0.9.0 — 2016-09-17

## README

# matrix-transposer

[![](https://travis-ci.org/jsuzuki20120311/matrix-transposer.svg?branch=master)](https://travis-ci.org/jsuzuki20120311/matrix-transposer.svg?branch=master) [![Code Climate](https://codeclimate.com/github/jsuzuki20120311/matrix-transposer/badges/gpa.svg)](https://codeclimate.com/github/jsuzuki20120311/matrix-transposer)


## Abstract
Transpose 2D array.


## License
MIT

## install
```sh
$ npm install --save matrix-transposer
```

## import
### Node.js
```javascript
var MatrixTransposer = require('matrix-transposer').default;
```
### EcmaScript2015
```javascript
import MatrixTransposer from 'matrix-transposer';
```

## How to use

### Example 1

```javascript

var array = [
  [1, 2, 3],
  [4, 5, 6]
];

var result = MatrixTransposer.arrayTranspose(array);
// result
// [
//   [1, 4],
//   [2, 5],
//   [3, 6]
// ]

```

### Example 2

```javascript

var array = [
  [1],
  [4, 5, 6]
];

// option
var option = {
  referenceIndex: 1, // default: 0 
  defaultValue: 0 // default: null
};

var result = MatrixTransposer.arrayTranspose(array, option);
// result
// [
//   [1, 4],
//   [0, 5],
//   [0, 6]
// ]
```

```javascript

var array = [
  [1],
  [4, 5, 6]
];

// option
var option = {
  referenceIndex: 0, // default: 0 
  defaultValue: 0 // default: null
};

var result = MatrixTransposer.arrayTranspose(array, option);
// result
// [
//   [1, 4]
// ]

```

---
_Source: https://npm.io/package/matrix-transposer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
