# simple-artifact-builder

> A tool to declaratively define best practices, maintainable evolve them, and scalably enforce them.

Latest version **1.1.15** (published 2025-11-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install simple-artifact-builder
pnpm add simple-artifact-builder
yarn add simple-artifact-builder
bun add simple-artifact-builder
```

Provides the command `simple-artifact-builder`.

## Health

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

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

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.1.15 |
| Published | 2025-11-29 |
| First published | 2021-11-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=12.0.0 |
| Dependencies | 17 |
| Unpacked size | 97.3 KB |
| Known vulnerabilities | 0 (+6 in 3 direct dependencies) |
| Install scripts | no |
| Author | ehmpathy |
| Maintainers | uladkasach |
| Keywords | declarative, best, practice, best-practice, best-practices, maintainable, scalable, repository, linting, fix |

## Links

- npm: https://www.npmjs.com/package/simple-artifact-builder
- Repository: https://github.com/ehmpathy/simple-artifact-builder
- Issues: https://github.com/ehmpathy/simple-artifact-builder/issues
- npm.io page: https://npm.io/package/simple-artifact-builder

## Dependencies (17)

- [joi](https://npm.io/package/joi.md) 17.4.0
- [uuid](https://npm.io/package/uuid.md) 9.0.0
- [yaml](https://npm.io/package/yaml.md) 1.6.0
- [chalk](https://npm.io/package/chalk.md) 4.1.2
- [oclif](https://npm.io/package/oclif.md) 3.6.5
- [ts-node](https://npm.io/package/ts-node.md) 8.6.2
- [archiver](https://npm.io/package/archiver.md) 5.3.0
- [type-fns](https://npm.io/package/type-fns.md) 1.21.0
- [fast-glob](https://npm.io/package/fast-glob.md) 3.2.2
- [@oclif/core](https://npm.io/package/@oclif/core.md) 2.0.11
- [@vercel/nft](https://npm.io/package/@vercel/nft.md) 0.27.3
- [pretty-bytes](https://npm.io/package/pretty-bytes.md) 5.6.0
- [domain-objects](https://npm.io/package/domain-objects.md) 0.31.0
- [helpful-errors](https://npm.io/package/helpful-errors.md) 1.5.3
- [@oclif/plugin-help](https://npm.io/package/@oclif/plugin-help.md) 3.3.1
- [@ehmpathy/error-fns](https://npm.io/package/@ehmpathy/error-fns.md) 1.0.2
- [simple-leveled-log-methods](https://npm.io/package/simple-leveled-log-methods.md) 0.1.4

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@pandacss/eslint-plugin](https://npm.io/package/@pandacss/eslint-plugin.md) — 18.7K weekly downloads

## Recent versions

- 1.1.15 (latest) — 2025-11-29
- 1.1.14 — 2025-11-29
- 1.1.13 — 2024-07-27
- 1.1.12 — 2024-07-27
- 1.1.11 — 2023-02-17
- 1.1.9 — 2023-02-16
- 1.1.8 — 2023-02-05
- 1.1.7 — 2023-02-05
- 1.1.6 — 2022-12-23
- 1.1.2 — 2021-11-09
- 1.1.1 — 2021-11-09
- 1.1.0 — 2021-11-09
- 1.0.1 — 2021-11-04
- 1.0.0 — 2021-11-04

## README

simple-artifact-builder
==============

Easily create deployment artifacts with the minimum set of dependencies required. Tree-shaking made easy.

[![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)
[![Version](https://img.shields.io/npm/v/simple-artifact-builder.svg)](https://npmjs.org/package/simple-artifact-builder)
[![Codecov](https://codecov.io/gh/ehmpathy/simple-artifact-builder/branch/master/graph/badge.svg)](https://codecov.io/gh/ehmpathy/simple-artifact-builder)
[![Downloads/week](https://img.shields.io/npm/dw/simple-artifact-builder.svg)](https://npmjs.org/package/simple-artifact-builder)
[![License](https://img.shields.io/npm/l/simple-artifact-builder.svg)](https://github.com/ehmpathy/simple-artifact-builder/blob/master/package.json)

# Table of Contents
<!-- toc -->
* [Table of Contents](#table-of-contents)
* [Purpose](#purpose)
* [Usage](#usage)
* [artifact.yml](#artifactyml)
* [artifact.yml](#artifactyml-1)
* [Commands](#commands)
* [Contribution](#contribution)
<!-- tocstop -->

# Purpose

Deployment artifacts can easily get out of hand in size when unnecessary dependencies are included in it. `simple-artifact-builder` makes it easy to create deployment artifacts with only the dependencies required for your code and nothing more, through file tracing.

# Usage

### 1. install

```sh
npm install --save-dev simple-artifact-builder # install it
npx simple-artifact-builder help # and test that you can use it
```

### 2. configure

define your `artifact.yml` config file to specify what files should be included in the artifact with `trace` (to include it and its [traced](https://github.com/vercel/nft) dependencies) or `pick` (to just include that file).

for example, for an aws lambda service, you may use something like this:
```yml
# artifact.yml
trace:
- dist/contract/handlers/**/*.js # include the handlers of an aws-lambda
- !dist/contract/handlers/**/*.test.js # but make sure to not to include any test files

pick:
- config/*.json # also include the `config` directory, since we dynamically import it
```

alternatively, if you're deploying a `Next.JS` project, you may want to use the `.nft.json` trace output files that they already include. for example:
```yml
# artifact.yml
trace:
  - 'dist/server/handler.js' # trace the dependencies of the handler to include the handler and all the code it depends on
  - '.next/**/*.nft.json' # use the trace-output files that next.js automatically generates to include all of the dependencies of the .next server
  - '!.next/cache/**/*.nft.json' # dont use the trace-output files from the .next/cache dir though, as they're not actually defined correctly nor needed

pick:
  - '.next/**/*' # include this whole directory, since the nextjs-server-side-rendering server uses its contents through dynamic imports
  - '!.next/cache/**/*' # exclude the cache though, since that's only needed while compiling and is very large/heavy
```

### 3. use

now that you've configured your project's artifact settings, you can build the artifact.

for example, build the artifact into a zip file (e.g., for usage with [`serverless artifact input`](https://www.serverless.com/framework/docs/providers/aws/guide/packaging#artifact))
```sh
npx simple-artifact-builder zip
```

this will output:
- `.artifact/contents.zip` - the zipped up artifact, ready for deployment
- `.artifact/contents` - a directory which hold the contents that were zipped up
- `.artifact/contents.manifest.json` - a file which lists all of the files included in the contents
- `.artifact/contents.sizes.json` - a file which defines the sizes of each file included in the contents

# Commands
<!-- commands -->
* [`simple-artifact-builder help [COMMAND]`](#simple-artifact-builder-help-command)
* [`simple-artifact-builder zip`](#simple-artifact-builder-zip)

## `simple-artifact-builder help [COMMAND]`

display help for simple-artifact-builder

```
USAGE
  $ simple-artifact-builder help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI
```

_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v3.1.0/src/commands/help.ts)_

## `simple-artifact-builder zip`

builds and zips the artifact

```
USAGE
  $ simple-artifact-builder zip

OPTIONS
  -c, --config=config  (required) [default: artifact.yml] path to the artifact config yml
  -h, --help           show CLI help
```

_See code: [dist/contract/commands/zip.ts](https://github.com/ehmpathy/simple-artifact-builder/blob/v0.0.1/dist/contract/commands/zip.ts)_
<!-- commandsstop -->

# Contribution

Team work makes the dream work! Please create a ticket for any features you think are missing and, if willing and able, draft a PR for the feature :)

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