{"id":20449093,"url":"https://github.com/glanguage/jiaohu-wy","last_synced_at":"2026-03-19T15:54:40.709Z","repository":{"id":133842756,"uuid":"240499999","full_name":"GLanguage/jiaohu-wy","owner":"GLanguage","description":"A package for wenyan which provides standard node.js IO.","archived":false,"fork":false,"pushed_at":"2024-03-02T05:59:28.000Z","size":29,"stargazers_count":1,"open_issues_count":2,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-15T22:26:55.503Z","etag":null,"topics":["package","wenyan","wenyan-lang","wyg"],"latest_commit_sha":null,"homepage":null,"language":null,"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/GLanguage.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-14T12:08:55.000Z","updated_at":"2024-02-29T15:26:29.000Z","dependencies_parsed_at":"2024-11-15T10:39:00.364Z","dependency_job_id":"8110c56e-c1e1-49f3-82fb-d84070d44d90","html_url":"https://github.com/GLanguage/jiaohu-wy","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/GLanguage%2Fjiaohu-wy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GLanguage%2Fjiaohu-wy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GLanguage%2Fjiaohu-wy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GLanguage%2Fjiaohu-wy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GLanguage","download_url":"https://codeload.github.com/GLanguage/jiaohu-wy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241997530,"owners_count":20055118,"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":["package","wenyan","wenyan-lang","wyg"],"created_at":"2024-11-15T10:38:47.805Z","updated_at":"2025-10-29T20:04:11.640Z","avatar_url":"https://github.com/GLanguage.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# 交互秘術\n使用標準node.js交互。\n\n## 安裝\n```\nwyg i 交互秘術\n```\n或\n```\nwyg i jiaohu\n```\n\n## 使用\n```\n吾嘗觀「「交互秘術」」之書。方悟\n「正閱」\n「已閱」\n「化言」\n「發生」\n「監聽」\n「閱止」\n「輸出」\n之義。\n```\n\n| Wenyan | Node.js |\n| ------ | ------ |\n| `寫「甲」焉` | `process.stdout.write(甲);` |\n| `施「化言」於「甲」` | `甲 = 甲.toString();` |\n| `「正閱」` | `\"data\"` |\n| `「已閱」` | `\"end\"` |\n| `施「閱止」` | `process.stdin.end();` |\n| `生「甲」之事` | `process.stdin.emit(甲);` |\n| `聽得「甲」之事乃行「乙」之術` | `process.stdin.on(甲, 乙);` |\n\n## 注意事項\n輸入所得為`Buffer`，須施`「化言」`於之，以化之為`言`。  \n\n輸入完成後按`Enter`結束輸入，`Enter`將輸入一個換行符（`\\n`或`\\r\\n`）。回調函數`「乙」`處理時，應注意這個換行符，不能忽略。  \n\n使用`書之`輸出時，會在結尾自動添加一個換行符；若使用`寫「甲」焉`輸出，則不會添加換行符。\n\n欲行`聽得「甲」之事乃行「乙」之術`，須先悟`「監聽」`之義；  \n欲行`生「甲」之事`，須先悟`「發生」`之義；  \n欲行`寫「甲」焉`，須先悟`「輸出」`之義；  \n\n可用`但聞「甲」之事乃行「乙」之術`代替`聽得「甲」之事乃行「乙」之術`，其義蓋同。([#1](https://github.com/GLanguage/jiaohu-wy/issues/1))\n\n## 一例\n\n```\n吾嘗觀「「交互秘術」」之書。方悟\n「正閱」\n「已閱」\n「化言」\n「發生」\n「監聽」\n「閱止」\n「輸出」\n之義。\n\n吾有一術。名之曰「響應」。欲行是術。必先得一言。曰「輸入」。乃行是術曰。\n    施「化言」於「輸入」。昔之「輸入」者今其是矣。\n    寫「輸入」焉。\n    生「已閱」之事。\n是謂「響應」之術也。\n\n聽得「正閱」之事乃行「響應」之術。\n聽得「已閱」之事乃行「閱止」之術。\n```\n輸入：\n```\n問天地好在！\n\n```\n輸出：\n```\n問天地好在！\n\n```\n注意：輸入中包含了一個換行符，輸出中也有一個換行符。\n\n## 二例\n\n```\n吾嘗觀「「交互秘術」」之書。方悟\n「正閱」\n「已閱」\n「化數」\n「化言」\n「發生」\n「監聽」\n「閱止」\n「輸出」\n之義。\n\n吾有一言。曰「「猜測一個阿拉伯數字」」。書之。\n吾有一術。名之曰「猜數」。欲行是術。必先得一言。曰「輸入」。乃行是術曰。\n    施「化言」於「輸入」。昔之「輸入」者。今其是矣。\n        若「輸入」大於八者。\n            吾有一言。曰「「太大了」」。書之。\n        或若「輸入」小於八者。\n            吾有一言。曰「「太小了」」。書之。\n        或若「輸入」等於八者。\n            吾有一言。曰「「猜對了！」」。書之。\n            生「已閱」之事。噫。\n        若非。\n            吾有一言。曰「「這不是阿拉伯數字」」。書之。\n        也。    \n是謂「猜數」之術也。\n\n但聞「正閱」之事乃行「猜數」之術。\n但聞「已閱」之事乃行「閱止」之術。\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglanguage%2Fjiaohu-wy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglanguage%2Fjiaohu-wy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglanguage%2Fjiaohu-wy/lists"}