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

xml2json5-disassembler

v1.0.4

Published

Disassemble XML files into smaller, more manageable JSON5 files and reassemble the XML when needed.

Readme

xml2json5-disassembler

NPM Downloads/week

DEPRECATION WARNING: This package is deprecated in favor of the latest xml-disassembler package, which can now handle disassembling XML files into smaller JSON5 files, as well as other file formats like YAML and JSON. Please migrate to the latest xml-disassembler.

Background

Transforms large XML files into smaller JSON5 files, a more flexible JSON format that allows comments and trailing commas, making it more developer-friendly. Supports reassembly into XML when required.

This is an extension of xml-disassembler.

Install

Install the package using NPM:

npm install xml2json5-disassembler

Usage

XML to JSON5

Disassemble then transform 1 or multiple XML files into JSON5 files.

/* 
FLAGS
- filePath:         Relative path to 1 XML file or a directory of XML files to disassemble into JSON5 files.
- uniqueIdElements: Comma-separated list of unique and required ID elements used to name disassembled files for nested elements. 
                    Defaults to SHA-256 hash if unique ID elements are undefined or not found.
- prePurge:         Delete pre-existing disassembled directories prior to disassembling the file.
- postPurge:        Delete the original XML file after disassembling it.

- ignorePath:       Path to an disassembly ignore file.
*/
import { XmlToJson5Disassembler } from "xml2json5-disassembler";

const handler = new XmlToJson5Disassembler();
await handler.disassemble({
  filePath: "test/baselines/general",
  uniqueIdElements:
    "application,apexClass,name,externalDataSource,flow,object,apexPage,recordType,tab,field",
  prePurge: true,
  postPurge: true,
  ignorePath: ".xmldisassemblerignore",
});

JSON5 to XML

Reassemble the disassembled JSON5 directory into 1 XML file.

/* 
FLAGS
- filePath:        Relative path to the disassembled JSON5 directory to reassemble as an XML file.
- fileExtension:   File extension for the reassembled XML.
                   (default: `.xml`)
- postPurge:       Delete the disassembled directory after reassembly.
*/
import { Json5ToXmlReassembler } from "xml2json5-disassembler";

const handler = new Json5ToXmlReassembler();
await handler.reassemble({
  filePath: "test/baselines/HR_Admin",
  fileExtension: "permissionset-meta.xml",
  postPurge: true,
});

Example

XML file (HR_Admin.permissionset-meta.xml)

<?xml version="1.0" encoding="UTF-8"?>
<PermissionSet xmlns="http://soap.sforce.com/2006/04/metadata">
    <applicationVisibilities>
        <application>JobApps__Recruiting</application>
        <visible>true</visible>
    </applicationVisibilities>
    <classAccesses>
        <apexClass>Send_Email_Confirmation</apexClass>
        <enabled>true</enabled>
    </classAccesses>
    <fieldPermissions>
        <editable>true</editable>
        <field>Job_Request__c.Salary__c</field>
        <readable>true</readable>
    </fieldPermissions>
    <description>Grants all rights needed for an HR administrator to manage employees.</description>
    <label>HR Administration</label>
    <userLicense>Salesforce</userLicense>
    <objectPermissions>
        <allowCreate>true</allowCreate>
        <allowDelete>true</allowDelete>
        <allowEdit>true</allowEdit>
        <allowRead>true</allowRead>
        <viewAllRecords>true</viewAllRecords>
        <modifyAllRecords>true</modifyAllRecords>
        <object>Job_Request__c</object>
    </objectPermissions>
    <pageAccesses>
        <apexPage>Job_Request_Web_Form</apexPage>
        <enabled>true</enabled>
    </pageAccesses>
    <recordTypeVisibilities>
        <recordType>Recruiting.DevManager</recordType>
        <visible>true</visible>
    </recordTypeVisibilities>
    <tabSettings>
        <tab>Job_Request__c</tab>
        <visibility>Available</visibility>
    </tabSettings>
    <userPermissions>
        <enabled>true</enabled>
        <name>APIEnabled</name>
    </userPermissions>
</PermissionSet>

Disassembled JSON5 Files

Ignore File

Reference ignore file section from xml-disassembler.

Logging

Reference logging section from xml-disassembler.

Import the setLogLevel function from xml2json5-disassembler to change the logging state.

import {
  XmlToJson5Disassembler,
  Json5ToXmlReassembler,
  setLogLevel,
} from "xml2json5-disassembler";

setLogLevel("debug");

Contributing

Contributions are welcome! See Contributing.

Template

This project was created from a template by Allan Oricil.

His original license remains in this project.