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

config-disassembler

v2.2.0

Published

Node.js bindings for the Rust config-disassembler crate.

Readme

config-disassembler

NPM License Downloads/week

Node.js bindings for the Rust config-disassembler crate via napi-rs.

Use it to disassemble large configuration files into smaller, version-control–friendly files and reassemble them later.

The Node bindings closely mirror the Rust crate APIs and behavior. For complete documentation and behavior details, see the Rust crate documentation.


Install

npm install config-disassembler

XML API Examples

Use this to disassemble a large XML into smaller files (XML, JSON, JSON5, YAML) and reassemble the XML.

import {
  DisassembleXMLFileHandler,
  ReassembleXMLFileHandler,
} from "config-disassembler";

const disassemble = new DisassembleXMLFileHandler();

/* Disassemble XML Options
* filePath = required. Path to the XML file or directory to disassemble.
* strategy = optional (default: unique-id). Disassembly strategy (unique-id or grouped-by-tag).
* uniqueIdElements = optional for unique-id strategy. Comma-separated element names used to derive filenames for nested elements.
* multiLevel = optional for unique-id strategy. One or more multi-level specs: file_pattern:root_to_strip:unique_id_elements. Pass a string (single rule) or a string[] for several rules; semicolon-separated strings are also accepted.
* splitTags = optional for grouped-by-tag strategy. split or group nested tags.
* prePurge = optional (default: false). Delete any pre-existing disassembled files before disassembly.
* postPurge = optional (default: false). Delete the XML file after successfully disassembling it.
* format = optional (default: xml). Output format: xml, json, json5, yaml.
* ignorePath = optional (default: .cdignore). Path to a .gitignore-like file to skip files while disassembling.
*/

// Disassemble using unique-ID strategy
disassemble.disassemble({
  filePath: "My.permissionset-meta.xml",
  uniqueIdElements:
    "application,apexClass,name,flow,object,recordType,tab,field",
  strategy: "unique-id",
  format: "json",
  prePurge: true,
  postPurge: true,
  ignorePath: ".cdignore",
});

// Or, disassemble using grouped-by-tag strategy
disassemble.disassemble({
  filePath: "My.permissionset-meta.xml",
  strategy: "grouped-by-tag",
  format: "json",
});

// Or, disassemble using grouped-by-tag strategy with split-tags
disassemble.disassemble({
  filePath: "My.permissionset-meta.xml",
  strategy: "grouped-by-tag",
  splitTags: "objectPermissions:split:object,fieldPermissions:group:field",
});

// Or, disassemble an XML over multiple-levels with unique-id strategy
disassemble.disassemble({
  filePath: "Cloud_Kicks_Inner_Circle.loyaltyProgramSetup-meta.xml",
  strategy: "unique-id",
  uniqueIdElements: "fullName,name,processName",
  multiLevel: "programProcesses:programProcesses:parameterName,ruleName",
  postPurge: true,
});

const reassemble = new ReassembleXMLFileHandler();

/* Reassemble XML Options
* filePath = required. Folder containing disassembled files to reassemble into 1 XML.
* fileExtension = optional (default: `.xml`). Set explicit file extension.
* postPurge = optional (default: false). Delete disassembled files after reassembly.
*/ 

reassemble.reassemble({
  filePath: "My",
  fileExtension: "permissionset-meta.xml",
  postPurge: true,
});

Value-Format API Examples

Use this for JSON, JSON5, JSONC, YAML, TOML, TOON, and INI configs.

import {
  DisassembleConfigFileHandler,
  ReassembleConfigFileHandler,
} from "config-disassembler";

// Disassemble config
const disassemble = new DisassembleConfigFileHandler();

const outputDir = disassemble.disassemble({
  input: "config.json",
  outputFormat: "yaml",
  uniqueId: "id",
});

// Reassemble config
const reassemble = new ReassembleConfigFileHandler();

reassemble.reassemble({
  inputDir: outputDir,
  output: "config.rebuilt.json",
  outputFormat: "json",
});

Supported Platforms

This package ships with prebuilt native binaries as platform-specific optional npm packages — your package manager installs only the one matching your os / cpu / libc:

| Platform | Architectures | | ----------- | ------------------------------------ | | macOS | x64 (Intel), arm64 (Apple Silicon) | | Linux | x64 (gnu + musl), arm64 (gnu + musl) | | Windows | x64, arm64, ia32 |

If your platform or architecture isn't listed, please open an issue.


Use Case

For a use-case using the XML API, see sf-decomposer.


License

MIT