# order-align

> In the order specified the array

Latest version **0.1.1** (published 2016-04-08) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install order-align
pnpm add order-align
yarn add order-align
bun add order-align
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2016-04-08 |
| First published | 2016-04-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | nju33 |
| Maintainers | nju33 |
| Keywords | order |

## Links

- npm: https://www.npmjs.com/package/order-align
- Repository: https://github.com/totora0155/order-align
- Homepage: https://github.com/totora0155/order-align#readme
- Issues: https://github.com/totora0155/order-align/issues
- npm.io page: https://npm.io/package/order-align

## Dependencies (2)

- [log4js](https://npm.io/package/log4js.md) ^0.6.33
- [lodash.get](https://npm.io/package/lodash.get.md) ^4.2.0

## Recent versions

- 0.1.1 (latest) — 2016-04-08
- 0.1.0 — 2016-04-08

## README

# orderAlign

[![Build Status](https://travis-ci.org/totora0155/order-align.svg?branch=master)](https://travis-ci.org/totora0155/order-align)
[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)
[![npm version](https://badge.fury.io/js/order-align.svg)](https://badge.fury.io/js/order-align)

In the order specified the array

## Install

```
npm i order-align
```

## Usage

```js
const orderAlign = require('order-align');
orderAlign(orderList, dataArr, targetKey);
```

## Example

### String

```js
const orderList = ['foo', 'bar', 'baz'];
const dataArr = ['baz', 'foo', 'bar'];

const result = orderAlign(orderList, dataArr);
console.log(result);
// [ 'foo', 'bar', 'baz' ]
```

### Object
```js
const orderList = ['foo', 'bar', 'baz'];
const dataArr = [
  {name: 'baz'},
  {name: 'foo'},
  {name: 'bar'}
];

const result = orderAlign(orderList, dataArr, 'name');
console.log(result);
// [ { name: 'foo' }, { name: 'bar' }, { name: 'baz' } ]
```

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