# installist

> install a list of packages

Latest version **1.1.0** (published 2021-05-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install installist
pnpm add installist
yarn add installist
bun add installist
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2021-05-18 |
| First published | 2021-04-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=8.0.0 |
| Dependencies | 7 |
| Unpacked size | 6.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | YizYah |
| Maintainers | yisroel |
| Keywords | ts-packrat, geenee, install, listr |

## Links

- npm: https://www.npmjs.com/package/installist
- Repository: https://github.com/YizYah/installist
- Issues: https://github.com/YizYah/installist/issues
- npm.io page: https://npm.io/package/installist

## Dependencies (7)

- [path](https://npm.io/package/path.md) ^0.12.7
- [chalk](https://npm.io/package/chalk.md) ^4.1.1
- [execa](https://npm.io/package/execa.md) ^5.0.0
- [listr](https://npm.io/package/listr.md) ^0.14.3
- [tslib](https://npm.io/package/tslib.md) ^2.0.3
- [typescript](https://npm.io/package/typescript.md) ^4.1.3
- [@types/node](https://npm.io/package/@types/node.md) ^14.14.19

## Recent versions

- 1.1.0 (latest) — 2021-05-18
- 1.0.0 — 2021-04-29

## README

[//]: # ( ns__file unit: standard, comp: README.md )

[//]: # ( ns__custom_start beginning )

[//]: # ( ns__custom_end beginning )

[//]: # ( ns__start_section intro )

[//]: # ( ns__custom_start description )

![](images/installist.gif)

creates a listr to install a list of packages from an array of names

[//]: # ( ns__custom_end description )

[//]: # ( ns__custom_start afterDescription )

[//]: # ( ns__custom_end afterDescription )

[//]: # ( ns__custom_start badges )

[//]: # ( ns__start_section usageSection )
[![codecov](https://codecov.io/gh/YizYah/installist/branch/main/graph/badge.svg?token=8esuJMyMMO)](https://codecov.io/gh/YizYah/installist)
[![Version](https://img.shields.io/npm/v/installist.svg)](https://npmjs.org/package/installist)
[![Downloads/week](https://img.shields.io/npm/dw/installist.svg)](https://npmjs.org/package/installist)
[![License](https://img.shields.io/npm/l/installist.svg)](https://github.com/YizYah/installist/blob/master/package.json)


[![Geenee](https://img.shields.io/badge/maintained%20by-geenee-brightgreen)](https://npmjs.org/package/geenee)
[![Template](https://img.shields.io/badge/template-ts--packrat-blue)](https://npmjs.org/package/ts-packrat)

[//]: # ( ns__custom_end badges )

[//]: # ( ns__end_section intro )


[//]: # ( ns__start_section api )


[//]: # ( ns__custom_start APIIntro )

# Why
Sometimes it's useful for a CLI to install packages into a directory.  you can create a dependency list, but installation has the advantage that the user will not have to call `npm install` for the packages to become available

# Usage
Install the package:
```
npm i installist
```
It exports two things: an enumeration `DepType` and a function `insallist`.  There are two `DepType` values: `MAIN` and `DEV`.  

The `installist` takes 3 parameters:
1. packages: string[] with the list of packages
2. dir: string indicating the directory
3. depType: DepType (MAIN=0 or DEV=1)

It returns a Listr, as specified in the [listr](https://www.npmjs.com/package/listr) package.  Here's a sample usage:
```
import { DepType, installist } from '../src/custom/installist';

const mainInstallation = [
  'barbells',
  'geenee-rate@0.1.10',
]

const codeDir='/tmp/testInstallist'

const listrToRun = await installist(mainInstallation,codeDir,DepType.MAIN)
await listrToRun.run()
```
This code installs into the `codeDir` directory the latest versions of `barbells` and version `0.1.10` of `geenee-rate`.  They are added to `package.json` in `codeDir` within `dependencies`.  

If `DevTypes.DEV` value is used, then `npm insert -D` is called for each element of the dependency list.


[//]: # ( ns__custom_end APIIntro )


[//]: # ( ns__custom_start constantsIntro )
[//]: # ( ns__custom_end constantsIntro )



[//]: # ( ns__start_section types )


[//]: # ( ns__end_section types )


[//]: # ( ns__end_section api )

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