npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

sf-decomposer-core

v7.17.0

Published

Decompose and recompose Salesforce metadata without the Salesforce CLI: a standalone sf-decomposer command and programmatic API.

Readme

sf-decomposer-core

sf-decomposer without the Salesforce CLI: a standalone sf-decomposer command and a programmatic API that decompose large Salesforce metadata XML files into smaller, version-control-friendly files and recompose them for deployment.

Use this package when you don't have, or don't want, the Salesforce CLI and an unsigned plugin install: in scripts, in CI images, or for coding agents. Use sf-decomposer for the sf decomposer CLI plugin and its retrieve/deploy hooks, and the GitHub Action for GitHub workflows.

All three are built from the same source and released with the same version number. Commands, flags, .sfdecomposer.config.json, and output are identical.

Requires Node.js 22.19 or later. Its only dependency is config-disassembler, which ships prebuilt native binaries for macOS, Linux, and Windows.

Command line

Run it inside a Salesforce DX project (a folder with sfdx-project.json, or below one):

npx sf-decomposer-core decompose -m flow -m permissionset
npx sf-decomposer-core recompose -m flow -m permissionset --postpurge
npx sf-decomposer-core verify -m permissionset

Or install it and call sf-decomposer directly:

npm install --save-dev sf-decomposer-core
npx sf-decomposer decompose --config

| Command | What it does | | ------------------------- | ----------------------------------------------------------------------------------------------- | | sf-decomposer decompose | Split large metadata files into smaller files. Run after retrieving metadata. | | sf-decomposer recompose | Rebuild deployment-ready metadata files from decomposed files. Run before deploying. | | sf-decomposer verify | Check in a temporary directory that a round trip preserves your metadata. Exits 1 on any drift. |

Each command takes the same flags as sf decomposer <command> (for example -m, -x, -f, -s, -p, -c, --prepurge, --postpurge), plus --json to print the result as JSON. Run sf-decomposer <command> --help for the list. See the sf-decomposer README for strategies, supported metadata, .forceignore, and config file options.

Programmatic API

import { decomposeMetadataTypes, recomposeMetadataTypes, verifyMetadataTypes } from 'sf-decomposer-core';

const log = (msg: string) => console.log(msg);

await decomposeMetadataTypes({
  metadataTypes: ['flow', 'permissionset'],
  format: 'xml',
  strategy: 'unique-id',
  prepurge: false,
  postpurge: false,
  decomposeNestedPerms: false,
  log,
});

const { drift } = await verifyMetadataTypes({
  metadataTypes: ['permissionset'],
  format: 'xml',
  strategy: 'unique-id',
  decomposeNestedPerms: false,
  log,
});

Paths resolve from sfdx-project.json found at or above process.cwd(). To apply .sfdecomposer.config.json the same way --config does, pass your inputs through resolveDecomposeOptions, resolveRecomposeOptions, or resolveVerifyOptions first.

The package is ESM-only.

License

MIT. Bundled third-party material (Salesforce's metadata registry from @salesforce/source-deploy-retrieve, Apache-2.0) is listed in THIRD_PARTY_NOTICES.md.