{"id":21945284,"url":"https://github.com/52cik/parse-wechat-xml","last_synced_at":"2025-04-22T21:14:23.634Z","repository":{"id":57319576,"uuid":"209522234","full_name":"52cik/parse-wechat-xml","owner":"52cik","description":"Parsing wechat XML data without using xml2js. (微信 XML 解析，非 xml2js)","archived":false,"fork":false,"pushed_at":"2019-09-19T13:15:59.000Z","size":5,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T18:51:13.845Z","etag":null,"topics":["wechat","weixin","xml","xml-parser"],"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/52cik.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":"2019-09-19T10:08:58.000Z","updated_at":"2022-08-20T16:12:46.000Z","dependencies_parsed_at":"2022-08-25T22:42:32.727Z","dependency_job_id":null,"html_url":"https://github.com/52cik/parse-wechat-xml","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/52cik%2Fparse-wechat-xml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/52cik%2Fparse-wechat-xml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/52cik%2Fparse-wechat-xml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/52cik%2Fparse-wechat-xml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/52cik","download_url":"https://codeload.github.com/52cik/parse-wechat-xml/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249977524,"owners_count":21354863,"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":["wechat","weixin","xml","xml-parser"],"created_at":"2024-11-29T04:18:10.179Z","updated_at":"2025-04-22T21:14:23.610Z","avatar_url":"https://github.com/52cik.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# parse-wechat-xml\n\n\u003e Parsing wechat XML without using xml2js.  \n\u003e 微信 XML 解析，非 xml2js\n\n源码非常简单，针对微信 xml 数据做最简化数据解析，核心部分20行，合适自行魔改。\n\n## 安装\n\n```sh\n$ yarn add parse-wechat-xml\n```\n\n## 使用\n\n```js\n// import parseWechatXML from 'parse-wechat-xml';\nconst { parseWechatXML } = require('parse-wechat-xml');\n\nconst xml = `\n\u003cxml\u003e\n  \u003cToUserName\u003e\u003c![CDATA[toUser]]\u003e\u003c/ToUserName\u003e\n  \u003cFromUserName\u003e\u003c![CDATA[fromUser]]\u003e\u003c/FromUserName\u003e\n  \u003cCreateTime\u003e1348831860\u003c/CreateTime\u003e\n  \u003cMsgType\u003e\u003c![CDATA[text]]\u003e\u003c/MsgType\u003e\n  \u003cContent\u003e\u003c![CDATA[this is a test]]\u003e\u003c/Content\u003e\n  \u003cMsgId\u003e1234567890123456\u003c/MsgId\u003e\n\u003c/xml\u003e\n`;\n\nconst msg = parseWechatXML(xml);\n\nmsg.ToUserName; // 开发者微信号\nmsg.FromUserName; // 发送方帐号\nmsg.CreateTime; // 消息创建时间\nmsg.Content; // 文本消息内容\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F52cik%2Fparse-wechat-xml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F52cik%2Fparse-wechat-xml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F52cik%2Fparse-wechat-xml/lists"}