# @loopback/dist-util

> Select dist directory based on Node.js major version.

Latest version **0.4.0** (published 2018-10-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install @loopback/dist-util
pnpm add @loopback/dist-util
yarn add @loopback/dist-util
bun add @loopback/dist-util
```

## Health

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

Positive: no vulnerabilities; high maintenance score.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2018-10-06 |
| First published | 2018-05-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.9 |
| Dependencies | 1 |
| Unpacked size | 6.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5096 |
| Author | IBM |
| Maintainers | 0candy, b-admike, bajtos, dhmlau, hacksparrow, jannyhou2016, kraman, mahesh.patsute, qpresley, rashmihunt, rfeng, ritch, rmg, superkhau, tonyf-ibm, virkt25 |
| Keywords | LoopBack |

## Links

- npm: https://www.npmjs.com/package/@loopback/dist-util
- Repository: https://github.com/strongloop/loopback-next
- Homepage: https://github.com/strongloop/loopback-next/tree/master/packages/dist-select
- Issues: https://github.com/strongloop/loopback-next/issues
- npm.io page: https://npm.io/package/@loopback/dist-util

## Dependencies (1)

- [semver](https://npm.io/package/semver.md) ^5.5.1

## Recent versions

- 0.4.0 (latest) — 2018-10-06
- 0.3.7 — 2018-09-10
- 0.3.6 — 2018-08-08
- 0.3.5 — 2018-07-21
- 0.3.4 — 2018-07-20
- 0.3.3 — 2018-06-20
- 0.3.2 — 2018-06-08
- 0.3.1 — 2018-05-08
- 0.3.0 — 2018-05-03
- 0.2.0 — 2018-05-03

## README

# @loopback/dist-util

**This package is no longer actively maintained.**

Please upgrade your project to use a single compilation target, for example by
changing your `build` script in `package.json` as follows:

```json
{
  "scripts": {
    "build": "lb-tsc es2017 --outDir dist"
  }
}
```

## Overview

Utilities to work with `dist` folders used by different Node.js versions.

| version | directory       |
| ------- | --------------- |
| 6.x LTS | _not supported_ |
| 8.x LTS | `dist8`         |
| 9.x     | `dist8`         |
| 10.x    | `dist10`        |
| newer   | `dist10`        |

## Installation

Run the following command to install this package:

```
$ npm install @loopback/dist-util
```

## Basic Use

Configure your TypeScript build to produce two distribution versions:

- `dist8` compiled for `es2017` target
- `dist10` compiled for `es2018` target

Put the following line to your main `index.js` file:

```js
module.exports = require('@loopback/dist-util').loadDist(__dirname);
// calls `require(__dirname + '/dist8')` or `require(__dirname + '/dist10')`
```

It is also possible to obtain the name of the correct `dist` directory without
loading the dist files:

```js
const dist = require('@loopback/dist-util').getDist();
console.log(dist);
// prints `dist8` or `dist10`
```

## Contributions

- [Guidelines](https://github.com/strongloop/loopback-next/blob/master/docs/CONTRIBUTING.md)
- [Join the team](https://github.com/strongloop/loopback-next/issues/110)

## Contributors

See
[all contributors](https://github.com/strongloop/loopback-next/graphs/contributors).

## License

MIT

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