# glob-pair

> Create source to destination mappings from globs

Latest version **2.0.1** (published 2016-03-02) · ISC license · 0 weekly downloads

## Install

```sh
npm install glob-pair
pnpm add glob-pair
yarn add glob-pair
bun add glob-pair
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2016-03-02 |
| First published | 2016-02-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 11 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Jordan Klassen |
| Maintainers | forivall |

## Links

- npm: https://www.npmjs.com/package/glob-pair
- Repository: https://github.com/forivall/errmsg
- Homepage: https://github.com/forivall/errmsg#readme
- Issues: https://github.com/forivall/errmsg/issues
- npm.io page: https://npm.io/package/glob-pair

## Dependencies (11)

- [glob](https://npm.io/package/glob.md) ^7.0.0
- [is-glob](https://npm.io/package/is-glob.md) ^2.0.1
- [minimatch](https://npm.io/package/minimatch.md) ^3.0.0
- [lodash.map](https://npm.io/package/lodash.map.md) ^4.2.0
- [path-parse](https://npm.io/package/path-parse.md) ^1.0.5
- [asyncaphore](https://npm.io/package/asyncaphore.md) ^1.1.0
- [path-format](https://npm.io/package/path-format.md) ^1.2.1
- [babel-runtime](https://npm.io/package/babel-runtime.md) ^6.5.0
- [lodash.foreach](https://npm.io/package/lodash.foreach.md) ^4.1.0
- [lodash.isarray](https://npm.io/package/lodash.isarray.md) ^4.0.0
- [path-is-absolute](https://npm.io/package/path-is-absolute.md) ^1.0.0

## Recent versions

- 2.0.1 (latest) — 2016-03-02
- 2.0.0 — 2016-02-20
- 1.1.1 — 2016-02-20
- 1.1.0 — 2016-02-20
- 1.0.1 — 2016-02-18
- 1.0.0 — 2016-02-17

## README

# glob-pair

Create source to destination mappings from globs. Geared toward usage for simple
CLI build tools. Created for [tacoscript].

[![build status](https://secure.travis-ci.org/forivall/glob-pair.svg)](http://travis-ci.org/forivall/glob-pair)
[![dependency status](https://david-dm.org/forivall/glob-pair.svg)](https://david-dm.org/forivall/glob-pair)

## Installation

```
npm install --save glob-pair
```

## Usage

Works similar to [lodash.zip](https://lodash.com/docs#zip), but with globs.

Except, if one value is given for the dest, all of the src values will be mapped
to it.

When multiple values are submitted for "dest", the same number of values must be
the "src" array.

```js
import globPair from "glob-pair";

globPair({src: ["*.scss"], dest: ["."], destExt: ".css"}, (src, dest) => {
  console.log(src, '->', dest); // a.scss -> a.css
}, (err) => {
  console.log(err || "Done!");
})

globPair({src: ["lib"], dest: ["dist"]}, (src, dest) => {
  console.log(src, '->', dest); // lib/index.js -> dist/lib/index.js
}, (err) => {
  console.log(err || "Done!");
})

globPair({src: ["src/*"], dest: ["lib"]}, (src, dest) => {
  console.log(src, '->', dest); // src/index.js -> lib/index.js
}, (err) => {
  console.log(err || "Done!");
})
```

## Credits
[Jordan Klassen](https://github.com/forivall/)

## Related modules

[expand-files]: Performs a similar function, but is more geared toward json
configuration | [homepage](https://github.com/jonschlinkert/expand-files)

## License

ISC

[tacoscript]: https://github.com/forivall/tacoscript
[expand-files]: https://www.npmjs.com/package/expand-files

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