{"id":29584451,"url":"https://github.com/lite-js/xml","last_synced_at":"2025-07-20T00:34:27.818Z","repository":{"id":57401855,"uuid":"66530387","full_name":"lite-js/xml","owner":"lite-js","description":"maintaining xml in pure javascript (IN BOTH NODE.JS \u0026 BROWSERS)","archived":false,"fork":false,"pushed_at":"2019-10-30T10:58:21.000Z","size":4496,"stargazers_count":20,"open_issues_count":2,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-29T17:15:59.273Z","etag":null,"topics":["javascript","js2xml","json2xml","xml","xml-lite","xml2js","xml2json"],"latest_commit_sha":null,"homepage":"https://lite-js.github.io/xml/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lite-js.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-25T06:15:29.000Z","updated_at":"2023-11-20T14:16:47.000Z","dependencies_parsed_at":"2022-09-15T18:41:26.985Z","dependency_job_id":null,"html_url":"https://github.com/lite-js/xml","commit_stats":null,"previous_names":["leungwensen/xml-lite"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/lite-js/xml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lite-js%2Fxml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lite-js%2Fxml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lite-js%2Fxml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lite-js%2Fxml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lite-js","download_url":"https://codeload.github.com/lite-js/xml/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lite-js%2Fxml/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266048716,"owners_count":23868744,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","js2xml","json2xml","xml","xml-lite","xml2js","xml2json"],"created_at":"2025-07-20T00:34:27.284Z","updated_at":"2025-07-20T00:34:27.804Z","avatar_url":"https://github.com/lite-js.png","language":"JavaScript","readme":"xml\n===\n\n[![npm version](https://badge.fury.io/js/%40lite-js%2Fxml.svg)](https://badge.fury.io/js/%40lite-js%2Fxml) [![Build Status](https://travis-ci.org/lite-js/xml.svg?branch=master)](https://travis-ci.org/lite-js/xml) [![Coverage Status](https://coveralls.io/repos/github/lite-js/xml/badge.svg?branch=master)](https://coveralls.io/github/lite-js/xml?branch=master)\n\n**Maintaining XML** in pure javascript (IN BOTH NODE.JS \u0026 BROWSERS) [Homepage][homepage]\n\n## Maintaining?\n\n### Converting\n\n![converting](./doc/uml/converting.png)\n\n### Editing/Traversing\n\n```javascript\nXMLLite.findChildNode(doc, query);\nXMLLite.findChildNodes(doc, query);\nXMLLite.findOrCreateChildNode(doc, query);\nXMLLite.removeChildNode(doc, query);\nXMLLite.eachChildNode(doc, query, callback);\n// ...\n```\n\n### Formatting\n\n```javascript\nXMLLite.beautify(xml, indent);\nXMLLite.uglify(xml, preserveComments);\nXMLLite.sanitize(xml, reverse);\n// ...\n```\n\nActually, you can get the js object from `XMLLite.xml2js(xml)`, do whatever you want, and convert it back to xml again with `XMLLite.js2xml(obj)`.\n\n## Why?\n\n1. A reasonable need for usage in both Node.js and Browsers\n2. A more reasonable need to use native APIs(DOMParser/XMLSerializer) to speed up the maintaining process and keep the library thin\n\n## Why `@lite-js/xml`?\n\n1. It **works exactly the same in both Node.js and Browsers**\n2. The browser version is supper **light-weight**([dist/xml.js](./dist/xml.js))\n3. **Convenient** APIs for converting between xml/js/json/DOM, and lots of helpers to maintain the data structures\n4. Super **fast**. it takes less than 30ms to convert an xml document with over 1,000 nodes into a js object\n\n## Install\n\n```shell\n$ npm install @lite-js/xml --save\n$ npm install @lite-js/xml -g\n```\n\n## Usage\n\nIn Node.js\n\n```javascript\nconst XML = require('@lite-js/xml');\n```\n\nCommand line client\n\n```shell\n$ xml-lite --help\n```\n\nIn browsers\n\n```html\n\u003cscript src=\"$path/to/@lite-js/xml/dist/xml.js\"\u003e \u003c!-- window.XML is available --\u003e\n```\n\nIn browsers with webpack\n\n```javascript\nimport XMLLite from '@lite-js/xml/indexBrowser';\n```\n\n## [Demo][homepage]\n\n## [API](./doc/api.md)\n\n## [JSON spec](./doc/json-spec.md)\n\n## [Projects using @lite-js/xml](./doc/projects-using-xml-lite.md)\n\n## [Contributing](./doc/contributing.md)\n\n## [known issues](https://github.com/lite-js/xml/issues)\n\n[homepage]: https://lite-js.github.io/xml/\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flite-js%2Fxml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flite-js%2Fxml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flite-js%2Fxml/lists"}