{"id":14483722,"url":"https://github.com/intuit/node-pom-parser","last_synced_at":"2025-05-15T05:31:40.611Z","repository":{"id":23682825,"uuid":"27054411","full_name":"intuit/node-pom-parser","owner":"intuit","description":"Parsing Java's pom.xml and properly returning the json object, including attributes and values.","archived":false,"fork":false,"pushed_at":"2023-10-03T15:25:38.000Z","size":75,"stargazers_count":22,"open_issues_count":6,"forks_count":28,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-02T14:47:41.433Z","etag":null,"topics":["enterprise","hacktoberfest","hacktoberfest2022","javascript","json","nexus","node-pom-parser","parser","pom"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/intuit.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-11-24T00:44:52.000Z","updated_at":"2024-08-11T09:18:29.000Z","dependencies_parsed_at":"2024-06-18T14:05:00.013Z","dependency_job_id":"381d338f-05aa-4aee-8f95-60296ffa2750","html_url":"https://github.com/intuit/node-pom-parser","commit_stats":null,"previous_names":["marcellodesales/node-pom-parser"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intuit%2Fnode-pom-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intuit%2Fnode-pom-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intuit%2Fnode-pom-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intuit%2Fnode-pom-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/intuit","download_url":"https://codeload.github.com/intuit/node-pom-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253942831,"owners_count":21988137,"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":["enterprise","hacktoberfest","hacktoberfest2022","javascript","json","nexus","node-pom-parser","parser","pom"],"created_at":"2024-09-03T00:02:02.642Z","updated_at":"2025-05-15T05:31:36.122Z","avatar_url":"https://github.com/intuit.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Node.js pom.xml Parser\n\n[![CI Build Status](https://github.com/intuit/node-pom-parser/actions/workflows/unit-tests.yml/badge.svg?branch=master)](https://github.com/intuit/node-pom-parser/actions/workflows/unit-tests.yml)\n![npm](https://img.shields.io/npm/v/node-pom-parser)\n[![CodeQL Analysis](https://github.com/intuit/node-pom-parser/actions/workflows/codeql.yml/badge.svg?branch=master)](https://github.com/intuit/node-pom-parser/actions/workflows/codeql.yml)\n[![Coverage Status](https://coveralls.io/repos/intuit/node-pom-parser/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/intuit/node-pom-parser?branch=master) \n![License](https://img.shields.io/github/license/intuit/node-pom-parser)\n\n[![NPM](https://nodei.co/npm/pom-parser.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/pom-parser/)\n\n# pom-parser\n\nParsing Java's `pom.xml` file and properly returning the JSON object, including all it's attributes and values.\n\n# Motivation\n\n* Your enterprise decided to move production code written in Java to Node.js\n* Your enterprise uses a centralized Nexus repository where your Java project uses pom.xml to manage app packaging\n* Your enterprise still plans to use Nexus repository to package Node.js applications\n* Your enterprise engineers want an API to retrieve information from the pom.xml file from those Node.js apps\n\n# Features\n\n* Reads any `pom.xml`\n* All XML elements are placed into properties\n* All XML element attributes are merged into the parent element\n* Both the XML string and the parsed object are returned\n* You can provide parsing options\n\n# Contributing\n\nPull requests are welcome!\n\n* See if an issue is already open, if not open\n* Discuss with team to prevent duplicate effort\n* Work up the PR and add/update unit tests\n* Raise PR against the `master` branch for the next release\n* Ensure all the Github Actions/checks are passing\n\n# Installation\n\n```sh\n$ npm install --save node-pom-parser\n$ yarn add node-pom-parser\n```\n\n# Use\n\n* Printing the object\n\n```js\nimport parse from './lib/index.js';\nimport { dirname } from 'path';\nimport { fileURLToPath } from 'url';\n\n//var pomParser = require(\"./lib/index\");\n// The required options, including the filePath.\n// Other parsing options from https://github.com/Leonidas-from-XIV/node-xml2js#options\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nvar opts = {\n  filePath: __dirname + \"/test/fixture/pom.xml\", // The path to a pom file\n};\n// Parse the pom based on a path\nparse(opts, function(err, pomResponse) {\n  if (err) {\n    console.log(\"ERROR: \" + err);\n    process.exit(1);\n  }\n\n  // The original pom xml that was loaded is provided.\n  console.log(\"XML: \" + pomResponse.pomXml);\n  // The parsed pom pbject.\n  console.log(\"OBJECT: \" + JSON.stringify(pomResponse.pomObject));\n});\n```\nIt should print the follow object with the following properties:\n\n* '_' represents the text value of an element with attributes and text values.\n\n```js\n{\n  \"project\": {\n    \"xmlns\": \"http://maven.apache.org/POM/4.0.0\",\n    \"xmlns:xsi\": \"http://www.w3.org/2001/XMLSchema-instance\",\n    \"xsi:schemaLocation\": \"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd\",\n    \"parent\": {\n      \"artifactid\": \"tynamo-parent\",\n      \"groupid\": \"org.tynamo\",\n      \"version\": \"0.0.9\"\n    },\n    \"modelversion\": {\n      \"_\": \"4.0.0\",\n      \"parallel\": \"now\"\n    },\n    \"groupid\": \"org.tynamo.examples\",\n    \"artifactid\": \"tynamo-example-federatedaccounts\",\n    \"version\": \"0.0.1-SNAPSHOT\",\n    \"packaging\": \"war\",\n    \"name\": \"Tynamo Example - Federated Accounts\",\n    \"properties\": {\n      \"tapestry-release-version\": \"5.3.1\",\n      \"gae.version\": \"1.3.0\",\n      \"gae.home\": \"${settings.localRepository}/com/google/appengine/appengine-api-1.0-sdk/${gae.version}/appengine-java-sdk-${gae.version}\",\n      \"gae.application.version\": \"0\"\n    },\n    \"build\": {\n      \"finalname\": \"federatedaccounts\",\n      \"resources\": {\n        \"resource\": [\n          {\n            \"directory\": \"src/main/resources\"\n          },\n          {\n            \"directory\": \"src/main/filtered-resources\",\n            \"filtering\": \"true\"\n          }\n        ]\n      },\n      \"plugins\": {\n        \"plugin\": [\n          {\n            \"groupid\": \"org.apache.maven.plugins\",\n            \"artifactid\": \"maven-compiler-plugin\",\n            \"configuration\": {\n              \"source\": \"1.6\",\n              \"target\": \"1.6\",\n              \"optimize\": \"true\"\n            }\n          },\n          {\n            \"groupid\": \"net.kindleit\",\n            \"artifactid\": \"maven-gae-plugin\",\n            \"version\": \"0.8.0\",\n            \"configuration\": {\n              \"serverid\": \"tynamo-example-federatedaccounts\"\n            }\n          },\n          {\n            \"groupid\": \"org.apache.maven.plugins\",\n            \"artifactid\": \"maven-war-plugin\",\n            \"configuration\": {\n              \"webresources\": {\n                \"resource\": {\n                  \"directory\": \"src/main/webapp\",\n                  \"filtering\": \"true\",\n                  \"includes\": {\n                    \"include\": \"**/appengine-web.xml\"\n                  }\n                }\n              }\n            }\n          }\n        ]\n      }\n    },\n    \"reporting\": {\n      \"plugins\": {\n        \"plugin\": {\n          \"groupid\": \"org.apache.tapestry\",\n          \"artifactid\": \"tapestry-component-report\",\n          \"version\": \"${tapestry-release-version}\",\n          \"configuration\": {\n            \"rootpackage\": \"org.tynamo\"\n          }\n        }\n      }\n    },\n    \"dependencies\": {\n      \"dependency\": [\n        {\n          \"groupid\": \"com.google.appengine\",\n          \"artifactid\": \"appengine-api-1.0-sdk\",\n          \"version\": \"${gae.version}\"\n        },\n        {\n          \"groupid\": \"com.h2database\",\n          \"artifactid\": \"h2\"\n        },\n        {\n          \"groupid\": \"org.apache.tapestry\",\n          \"artifactid\": \"tapestry-core\",\n          \"version\": \"${tapestry-release-version}\"\n        },\n        {\n          \"groupid\": \"javax.servlet\",\n          \"artifactid\": \"servlet-api\",\n          \"version\": \"2.5\",\n          \"type\": \"jar\",\n          \"scope\": \"provided\"\n        }\n      ]\n    },\n    \"profiles\": {\n      \"profile\": {\n        \"id\": \"repositories\",\n        \"repositories\": {\n          \"repository\": {\n            \"id\": \"maven-gae-plugin-repo\",\n            \"name\": \"maven-gae-plugin repository\",\n            \"url\": \"http://maven-gae-plugin.googlecode.com/svn/repository\"\n          }\n        },\n        \"pluginrepositories\": {\n          \"pluginrepository\": {\n            \"id\": \"maven-gae-plugin-repo\",\n            \"name\": \"maven-gae-plugin repository\",\n            \"url\": \"http://maven-gae-plugin.googlecode.com/svn/repository\"\n          }\n        }\n      }\n    }\n  }\n}\n```\n\n# License\n\n`node-pom-parser` is provided under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintuit%2Fnode-pom-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintuit%2Fnode-pom-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintuit%2Fnode-pom-parser/lists"}