{"id":42759711,"url":"https://github.com/pengng/xml-js-parse","last_synced_at":"2026-01-29T20:31:33.626Z","repository":{"id":57154928,"uuid":"112418117","full_name":"pengng/xml-js-parse","owner":"pengng","description":"Parse the xml as a js object or build an xml through a js object.","archived":false,"fork":false,"pushed_at":"2017-11-29T02:56:12.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-10T22:53:29.981Z","etag":null,"topics":["convert","object","parse","parser","xml"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pengng.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-29T02:52:39.000Z","updated_at":"2017-11-29T02:56:45.000Z","dependencies_parsed_at":"2022-09-07T12:22:22.526Z","dependency_job_id":null,"html_url":"https://github.com/pengng/xml-js-parse","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pengng/xml-js-parse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pengng%2Fxml-js-parse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pengng%2Fxml-js-parse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pengng%2Fxml-js-parse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pengng%2Fxml-js-parse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pengng","download_url":"https://codeload.github.com/pengng/xml-js-parse/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pengng%2Fxml-js-parse/sbom","scorecard":{"id":727100,"data":{"date":"2025-08-11","repo":{"name":"github.com/pengng/xml-js-parse","commit":"d2a91875e1ae6427f30ba5c4d2c8e9271044bc17"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.8,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":0,"reason":"Found 0/3 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":4,"reason":"6 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-h6ch-v84p-w6p9","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-776f-qx25-q3cc"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-22T13:08:49.469Z","repository_id":57154928,"created_at":"2025-08-22T13:08:49.469Z","updated_at":"2025-08-22T13:08:49.469Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28884291,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T19:55:09.949Z","status":"ssl_error","status_checked_at":"2026-01-29T19:55:08.490Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["convert","object","parse","parser","xml"],"created_at":"2026-01-29T20:31:33.150Z","updated_at":"2026-01-29T20:31:33.621Z","avatar_url":"https://github.com/pengng.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xml-js-parse\n\nParse the xml as a js object or build an xml through a js object.\n\n### Usage\n\n```bash\nnpm i xml-js-parse -S\n```\n\n```javascript\nconst xmlParser = new require('xml-js-parse').Parser()\nconst xml = `\n\u003cxml\u003e\n  \u003cname\u003exiaobai\u003c/name\u003e\n\u003c/xml\u003e\n`\nconst obj = xmlParser.parseString(xml)\n```\n\n### new Parser([options])\n\n- `options` \\\u003cObject\\\u003e 配置对象\n  - `trim` \\\u003cboolean\\\u003e 去除文本节点头尾的空格。默认为 `false` 。\n  - `normalize` \\\u003cboolean\\\u003e 去除文本节点内的空格。默认为 `false` 。\n  - `normalizeTags` \\\u003cboolean\\\u003e 将所有标签名转成小写字母。默认为 `false` 。\n  - `ignoreAttrs` \\\u003cboolean\\\u003e 忽略属性节点。默认为 `false` 。\n  - `attrkey` \\\u003cstring\\\u003e 设置属性节点的字段名。默认为 `$` 。\n  - `charkey` \\\u003cstring\\\u003e 设置文本节点的字段名。默认为 `_` 。\n  - `explicitArray` \\\u003cboolean\\\u003e 保存子元素为数组。默认为 `true` 。当设置为 `false` ，只有出现多个相同标签名的子元素时才合并成数组。\n\n### parseString\n\n解析 `xml` 数据为对象。\n\n- `xml` \\\u003cstring\\\u003e \n\n```javascript\nconst xmlParser = new Parser({ explicitArray: false })\nconst xml = `\n  \u003cuser\u003e\n    \u003cname\u003exiaobai\u003c/name\u003e\n    \u003cage\u003e12\u003c/age\u003e\n  \u003c/user\u003e\n  \u003cuser\u003e\n    \u003cname\u003exiaohong\u003c/name\u003e\n    \u003cage\u003e11\u003c/age\u003e\n  \u003c/user\u003e\n  \u003ccount\u003e2\u003c/count\u003e\n`\nconst result = xmlParser.parseString(xml)\n/**\n{\n  user: [\n    {\n      name: 'xiaobai',\n      age: '12'\n    },\n    {\n      name: 'xiaohong',\n      age: '11'\n    }\n  ],\n  count: '2'\n}\n*/\n```\n\n### new Builder([options])\n\n- `options` \\\u003cObject\\\u003e 配置对象\n  - `rootName` \\\u003cstring\\\u003e 根节点名称。默认为 `root` 。\n  - `renderOpts` \\\u003cObject\\\u003e \n    - `pretty` \\\u003cboolean\\\u003e 使用格式。默认为 `true` 。\n    - `indent` \\\u003cstring\\\u003e 缩进。默认为 `'  '` 。\n    - `newline` \\\u003cstring\\\u003e 换行。默认 `\\n` 。\n  - `xmldec` \\\u003cObject\\\u003e \n    - `version` \\\u003cstring\\\u003e 头信息，版本号。默认 `1.0` 。\n    - `encoding` \\\u003cstring\\\u003e 头信息，编码格式。默认 `UTF-8` 。\n    - `standalone` \\\u003cboolean\\\u003e 头信息，独立。默认 `true` 。\n  - `headless` \\\u003cboolean\\\u003e 去除头信息。默认 `false` 。\n  - `cdata` \\\u003cboolean\\\u003e 当文本节点包含非法 `xml` 字符时，用`\u003c![CDATA[……]]\u003e` 包含。默认 `false` 。\n\n### buildObject\n\n- obj \\\u003cObject\\\u003e 要构建 `xml` 的对象。\n\n```javascript\nconst xmlBuilder = new Builder()\nconst obj = { name: 'xiaobai' }\nconst xml = xmlBuilder.buildObject(obj)\n/**\n\u003croot\u003e\n  \u003cname\u003exiaobai\u003c/name\u003e\n\u003c/root\u003e\n*/\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpengng%2Fxml-js-parse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpengng%2Fxml-js-parse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpengng%2Fxml-js-parse/lists"}