# @apexdevtools/metadata-gulp

> Downloader for Salesforce metadata to support Apex static analysis

Latest version **3.0.2** (published 2026-06-14) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install @apexdevtools/metadata-gulp
pnpm add @apexdevtools/metadata-gulp
yarn add @apexdevtools/metadata-gulp
bun add @apexdevtools/metadata-gulp
```

## Health

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

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

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 3.0.2 |
| Published | 2026-06-14 |
| First published | 2022-07-10 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | ^20.19.0 \|\| ^22.13.0 \|\| >=24 |
| Dependencies | 7 |
| Unpacked size | 95.9 KB |
| Known vulnerabilities | 0 (+5 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Apex Dev Tools Team |
| Maintainers | apexdevtools |
| Keywords | salesforce, apex, metadata |

## Links

- npm: https://www.npmjs.com/package/@apexdevtools/metadata-gulp
- Repository: https://github.com/apex-dev-tools/metadata-gulp
- Homepage: https://github.com/apex-dev-tools/metadata-gulp#readme
- Issues: https://github.com/apex-dev-tools/metadata-gulp/issues
- npm.io page: https://npm.io/package/@apexdevtools/metadata-gulp

## Dependencies (7)

- [rimraf](https://npm.io/package/rimraf.md) ^5.0.1
- [jsforce](https://npm.io/package/jsforce.md) ^1.11.0
- [p-queue](https://npm.io/package/p-queue.md) ^6.6.2
- [decompress](https://npm.io/package/decompress.md) ^4.2.1
- [fast-xml-parser](https://npm.io/package/fast-xml-parser.md) ^4.2.4
- [easy-soap-request](https://npm.io/package/easy-soap-request.md) ^5.3.0
- [@apexdevtools/sfdx-auth-helper](https://npm.io/package/@apexdevtools/sfdx-auth-helper.md) ^2.1.1

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 3.0.2 (latest) — 2026-06-14
- 3.0.1 — 2023-12-08
- 3.0.0 — 2023-06-22
- 2.2.0 — 2023-03-29
- 2.1.0 — 2022-12-08
- 2.0.0 — 2022-07-10

## README

# metadata-gulp

Salesforce metadata download library. Pulls metadata from an org in a format that can be used with [apex-ls](https://github.com/apex-dev-tools/apex-ls) based tools to perform off-line semantics analysis of Apex code.

## Usage

To start a download use update() from Gulp:

```ts
async update(
    workspacePath: string,
    logger: Logger,
    connection: JSConnection | null,
    namespaces: string[],
    partialLoad: boolean
): Promise<void>
```

The workspacePath must be the directory where your sfdx-project.json file is located. The metadata is downloaded into a '.apexlink/gulp' directory relative to this.

If you have an open [jsforce](https://github.com/jsforce/jsforce) connection you can pass that, if you pass null a new connection will be created.

Metadata is download independently for each passed namespace. For orgs without a namespace you can use the pseudo namespace _unmanaged_. If partialLoad is false, existing downloaded metadata for namespaces not passed to update() will be removed automatically.

The library also supplies some helper functions that you may find useful.

To obtain the org's default namespace:

```ts
async getOrgNamespace(
    workspacePath: string,
    connection: JSConnection | null
): Promise<string | null | undefined>
```

This will return string | null on success or undefined if the Organization table can not be queried.

To obtain the namespace & package description for packages with namespaces on the org:

```ts
async getOrgPackageNamespaces(
    workspacePath: string,
    connection: JSConnection | null
): Promise<NamespaceInfo[]>
```

## Development

### Building

This project uses the `pnpm` package manager.

```txt
  pnpm install
  pnpm build
```

To run unit tests:

```txt
  pnpm test
```

To test bundling using webpack:

```txt
  pnpm test:pack
  node test-bundle/bundle.js
```

This should execute without error.

Execute manual test script with [`ts-node`](https://github.com/TypeStrong/ts-node#usage) using the run script:

```txt
  # Run gulp on a project with an existing default org
  pnpm run:script -- ./src/scripts/main.ts <workspaceDir> <namespace | unmanaged>
```

## License

All the source code included uses a 3-clause BSD license, see LICENSE for details.

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