# build-keys

> Get the paths of files from your build

Latest version **1.0.0** (published 2017-09-06) · MPL-2.0 license · 0 weekly downloads

## Install

```sh
npm install build-keys
pnpm add build-keys
yarn add build-keys
bun add build-keys
```

## 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 | 1.0.0 |
| Published | 2017-09-06 |
| First published | 2016-09-05 |
| Weekly downloads | 0 |
| License | MPL-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8 |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Seth Holladay |
| Maintainers | sholladay |
| Keywords | build, builds, key, keys, path, paths, file, files, filepath, filepaths |

## Links

- npm: https://www.npmjs.com/package/build-keys
- Repository: https://github.com/sholladay/build-keys
- Issues: https://github.com/sholladay/build-keys/issues
- npm.io page: https://npm.io/package/build-keys

## Dependencies (2)

- [glob](https://npm.io/package/glob.md) ^7.0.6
- [build-data](https://npm.io/package/build-data.md) ^0.4.0

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2017-09-06
- 0.2.0 — 2016-09-09
- 0.1.0 — 2016-09-05

## README

# build-keys [![Build status for build-keys](https://img.shields.io/circleci/project/sholladay/build-keys/master.svg "Build Status")](https://circleci.com/gh/sholladay/build-keys "Builds")

> Get the paths of files from your build

## Why?

 - Useful for copying build artifacts.
 - Agnostic of how the files were written.
 - Excludes directories, perfect for [Amazon S3](https://aws.amazon.com/s3/).

## Install

```sh
npm install build-keys --save
```

## Usage

Get it into your program.

```js
const buildKeys = require('build-keys');
```

Get a list of the filepaths that exist within the most recent build, excluding directories.

```js
buildKeys.latest().then((keys) => {
    console.log('keys:', keys);
    // [
    //     'master/1.0.0/foo.js',
    //     'master/latest/foo.js'
    // ]
});
```

## API

### buildKeys.latest(option)

Returns a `Promise<Array>` of paths for files within the latest build. Does not include directories. Designed for use with [Amazon S3](https://aws.amazon.com/s3/).

#### option

Type: `object`

Settings and known [build data](https://github.com/sholladay/build-data).

##### cwd

Type: `string`<br>
Default: `process.cwd()`

The parent directory of the build root.

##### branch

Type: `string`

Match the files from the given branch name, rather than the most recently built branch.

##### version

Type: `string`

Match the files from the given version, rather than the most recently built version of the branch.

##### includeBranchLatest

Type: `boolean`<br>
Default: `true`

Whether to also match the files at the `<branch>/latest` path.

## Related

 - [delivr](https://github.com/sholladay/delivr) - Build your code and ship it to [S3](https://aws.amazon.com/s3/)
 - [build-files](https://github.com/sholladay/build-files) - Read the files from your build
 - [build-dir](https://github.com/sholladay/build-dir) - Get a place to put your build
 - [build-data](https://github.com/sholladay/build-data) - Get metadata for your build
 - [build-path](https://github.com/sholladay/build-path) - Get a path for the given build
 - [build-version](https://github.com/sholladay/build-version) - Get a version for your build

## Contributing

See our [contributing guidelines](https://github.com/sholladay/build-keys/blob/master/CONTRIBUTING.md "The guidelines for participating in this project.") for more details.

1. [Fork it](https://github.com/sholladay/build-keys/fork).
2. Make a feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. [Submit a pull request](https://github.com/sholladay/build-keys/compare "Submit code to this project for review.").

## License

[MPL-2.0](https://github.com/sholladay/build-keys/blob/master/LICENSE "License for build-keys") © [Seth Holladay](https://seth-holladay.com "Author of build-keys")

Go make something, dang it.

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