# subpkg

> Minimal utility for managing projects with sub-packages

Latest version **4.2.0** (published 2026-09-24) · MIT license · 0 weekly downloads

## Install

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

Provides the command `subpkg`.

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score.

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

## Facts

| | |
|---|---|
| Version | 4.2.0 |
| Published | 2026-09-24 |
| First published | 2019-06-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Kirk Scheibelhut |
| Maintainers | kjscheibo |
| Keywords | minimal, package, sub-package |

## Links

- npm: https://www.npmjs.com/package/subpkg
- Repository: https://github.com/scheibo/subpkg
- Homepage: https://github.com/scheibo/subpkg#readme
- Issues: https://github.com/scheibo/subpkg/issues
- npm.io page: https://npm.io/package/subpkg

## Recent versions

- 4.2.0 (latest) — 2026-09-24
- 4.1.0 — 2020-12-03
- 4.0.2 — 2020-11-06
- 4.0.1 — 2020-09-25
- 4.0.0 — 2020-09-25
- 3.0.3 — 2020-06-06
- 3.0.2 — 2020-06-05
- 3.0.1 — 2020-06-05
- 3.0.0 — 2020-05-27
- 2.0.0 — 2020-03-13
- 1.0.0 — 2020-03-13
- 0.0.1 — 2019-06-10

## README

# `subpkg`

[![npm version](https://img.shields.io/npm/v/subpkg.svg)](https://www.npmjs.com/package/subpkg)

`subpkg` is a roughly API-compatible implementation of
[`subpackage`](https://github.com/dupski/subpackage) which has zero dependencies and trades support
for environment variables for several additional features like linking and version bumping. `subpkg`
allows you to run scripts defined in `package.json` across multiple sub-projects and serves as a
minimal alternative to [Lerna](https://github.com/lerna/lerna) or `pnpm`'s support for
['workspaces'](https://pnpm.js.org/en/workspaces).

## Usage

```sh
$ npm install --save-dev subpkg
```

```json
{
    "name": "my-awesome-project",
    "version": "2.5.1",
    "subPackages": [
        "packages/sub-package-1",
        "packages/sub-package-2"
    ],
    "scripts": {
      "postinstall": "subpkg install && ...",
      "build": "subpkg run build && ..."
    }
}
```

### Dynamic modules

```json
{
    "name": "my-awesome-project",
    "version": "2.5.1",
    "subPackages": {
        "dirA" : "packagesA.json",
        "dirB" : "packagesB.json"
    },
    "scripts": {
      "postinstall": "subpkg install && ...",
      "build": "subpkg run build && ..."
    }
}
```

Where `packagesA.json` is a JSON file specifying active/inactive packages in the directory `dirA`
and both `dirA` and `packagesA.json` are paths relative to root directory:

```json
{
    "sub-package-1": true,
    "sub-package-2": true,
    "sub-package-3": false,
}
```

Modules set to `false` will not be taken into account.

#### Laravel Modules

This feature allows for seamless integration with the
[nWidart/laravel-modules](https://github.com/nWidart/laravel-modules) project:

```json
{
    "name": "my-awesome-project",
    "version": "2.5.1",
    "subPackages": {
        "modules" : "modules_statuses.json"
    }
}
```

## License

`subpkg` is distributed under the terms of the [MIT License](LICENSE).

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