{"id":23346331,"url":"https://github.com/tuckn/wshmodejs","last_synced_at":"2025-04-07T17:19:51.573Z","repository":{"id":38282269,"uuid":"264089327","full_name":"tuckn/WshModeJs","owner":"tuckn","description":"The modern WSH (Windows Script Host) JScript library that mode of like Node.js. ","archived":false,"fork":false,"pushed_at":"2024-03-03T02:56:06.000Z","size":330,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-13T19:39:01.110Z","etag":null,"topics":["jscript","module","windows","wsf","wsh"],"latest_commit_sha":null,"homepage":"https://tuckn.net/docs/WshModeJs/","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/tuckn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["tuckn"],"patreon":"tuckn","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"lfx_crowdfunding":null,"custom":null}},"created_at":"2020-05-15T03:46:07.000Z","updated_at":"2024-01-25T21:37:20.000Z","dependencies_parsed_at":"2024-01-27T23:31:06.842Z","dependency_job_id":"741a1432-93fb-4a2a-9504-563a213dac5d","html_url":"https://github.com/tuckn/WshModeJs","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuckn%2FWshModeJs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuckn%2FWshModeJs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuckn%2FWshModeJs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tuckn%2FWshModeJs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tuckn","download_url":"https://codeload.github.com/tuckn/WshModeJs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247694882,"owners_count":20980733,"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":["jscript","module","windows","wsf","wsh"],"created_at":"2024-12-21T07:13:30.560Z","updated_at":"2025-04-07T17:19:51.538Z","avatar_url":"https://github.com/tuckn.png","language":"JavaScript","funding_links":["https://github.com/sponsors/tuckn","https://patreon.com/tuckn"],"categories":[],"sub_categories":[],"readme":"# WshModeJs\n\nThe modern WSH (Windows Script Host) JScript library that mode like Node.js.\n\n[Presentation PDF](https://tuckn.net/assets/20240302T131713JST_promoteWshModeJs-en_pub.pdf)\n\n## tuckn/Wsh series dependency\n\nWshModeJs - This repository  \n└─ [WshZLIB](https://github.com/tuckn/WshZLIB)  \n\u0026emsp;└─ [WshNet](https://github.com/tuckn/WshNet)  \n\u0026emsp;\u0026emsp;└─ [WshChildProcess](https://github.com/tuckn/WshChildProcess)  \n\u0026emsp;\u0026emsp;\u0026emsp;└─ [WshProcess](https://github.com/tuckn/WshProcess)  \n\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;└─ [WshFileSystem](https://github.com/tuckn/WshFileSystem)  \n\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;└─ [WshOS](https://github.com/tuckn/WshOS)  \n\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;└─ [WshPath](https://github.com/tuckn/WshPath)  \n\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;└─ [WshUtil](https://github.com/tuckn/WshUtil)  \n\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;└─ [WshPolyfill](https://github.com/tuckn/WshPolyfill)\n\nThe upper layer module can use all the functions of the lower layer module.\n\n## Operating environment\n\nWorks on JScript in Windows.\n\n## Installation\n\n(1) Create a directory of your WSH project.\n\n```console\nD:\\\u003e mkdir MyWshProject\nD:\\\u003e cd MyWshProject\n```\n\n(2) Download this ZIP and unzip or Use the following `git` command.\n\n```console\n\u003e git clone https://github.com/tuckn/WshModeJs.git ./WshModules/WshModeJs\nor\n\u003e git submodule add https://github.com/tuckn/WshModeJs.git ./WshModules/WshModeJs\n```\n\n(3) Create your JScript (.js) file. For Example,\n\n```console\nD:\\MyWshProject\\\n├─ MyScript.js \u003c- Your JScript code will be written in this.\n└─ WshModules\\\n    └─ WshModeJs\\\n        └─ dist\\\n          └─ bundle.js\n```\n\nI recommend JScript (.js) file encoding to be UTF-8 [BOM, CRLF].\n\n(4) Create your WSF packaging scripts file (.wsf).\n\n```console\nD:\\MyWshProject\\\n├─ Run.wsf \u003c- WSH entry file\n├─ MyScript.js\n└─ WshModules\\\n    └─ WshModeJs\\\n        └─ dist\\\n          └─ bundle.js\n```\n\nAnd you should include _.../dist/bundle.js_ into the WSF file.\nFor Example, The content of the above _Run.wsf_ is\n\n```xml\n\u003cpackage\u003e\n  \u003cjob id = \"run\"\u003e\n    \u003cscript language=\"JScript\" src=\"./WshModules/WshModeJs/dist/bundle.js\"\u003e\u003c/script\u003e\n    \u003cscript language=\"JScript\" src=\"./MyScript.js\"\u003e\u003c/script\u003e\n  \u003c/job\u003e\n\u003c/package\u003e\n```\n\nI recommend this WSH file (.wsf) encoding to be UTF-8 [BOM, CRLF].\n\nAwesome! This WSH configuration allows you to use the following functions in JScript (_.\\\\MyScript.js_).\n\n## Usage\n\nNow you can use the following many helpful functions in _.\\\\MyScript.js_ (JScript).\n\n- [tuckn/WshPolyfill](https://github.com/tuckn/WshPolyfill)\n- [tuckn/WshUtil](https://github.com/tuckn/WshUtil)\n- [tuckn/WshPath](https://github.com/tuckn/WshPath)\n- [tuckn/WshOS](https://github.com/tuckn/WshOS)\n- [tuckn/WshFileSystem](https://github.com/tuckn/WshFileSystem)\n- [tuckn/WshProcess](https://github.com/tuckn/WshProcess)\n- [tuckn/WshChildProcess](https://github.com/tuckn/WshChildProcess)\n- [tuckn/WshNet](https://github.com/tuckn/WshNet)\n- [tuckn/WshZLIB](https://github.com/tuckn/WshZLIB)\n\nAnd also, use the following functions.\nFor Example,\n\n### Readline\n\n```js\nvar rl = Wsh.Readline; // Shorthand\n\nvar answer = rl.questionSync('Are you an engineer?/y or Not');\n\nif (answer.toUpperCase() !== 'Y') return false;\n\n// Now only `questionSync` works...\n```\n\n### Buffer (W.I.P)\n\n[Buffer](https://tuckn.net/docs/WshModeJs/Buffer.html) object is defined globally.\n\n```js\nvar buf = Buffer.from('012345XYZ');\n\nconsole.log(buf.toString('utf8')); // 012345XYZ\nconsole.log(buf.toString('base64')); // MDEyMzQ1WFla\nconsole.log(buf.toString('hex')); // 30313233343558595a\nconsole.log(buf.values()); // \u003cBuffer 30 31 32 32 ....\u003e\n\n// Now only `from` works...\n```\n\n### Http\n\n```js\nvar http = Wsh.Http; // Shorthand\n\n// Ex 1. Auto JSON parsing\n http.request('https://httpbin.org/ip');\n// Returns: { origin: '111.222.333.444' }\n\n// Ex 2. Basic Auth\nhttp.request('https://httpbin.org/basic-auth', { auth: 'myUser:myPasswd' });\n\n// Ex 3. Using proxy\nhttp.request('https://httpbin.org/headers', {\n  proxy: {\n    host: '192.168.12.34',\n    port: 8087,\n    proxyAuth: 'proxyUser:proxyPassword'\n});\n// Returns:\n// { headers: {\n//     Accept: \"\\*\\/*\",\n//     Accept-Language: \"ja\",\n//     Host: \"httpbin.org\",\n//     User-Agent: \"Mozilla/4.0 (compatible; Win32; WinHttp.WinHttpRequest.5)\",\n//     X-Amzn-Trace-Id: \"Root=1-1234abcd-12345678abcdefg123456789\"\n//   }\n// }\n\n// Ex 4. POST data\nhttp.request('https://httpbin.org/post?argA=valA', {\n  method: 'POST',\n  dataToSend: 'formB=' + encodeURIComponent('value B')\n});\n// Returns:\n// { args: { argA: \"valA\" },\n//   data: \"\",\n//   files: {},\n//   form: { formB: \"valB\" },\n//   headers: { ... },\n//   json: null,\n//   origin: \"111.222.333.444\",\n//   url: \"https://httpbin.org/post?%3FargA=valA\" }\n\n// Now only `request` works...\n```\n\n## TODO\n\n- Buffer, Http, Readline.\n\n## Documentation\n\nSee all specifications [here](https://tuckn.net/docs/WshModeJs/) and also below.\n\n- [WshPolyfill](https://tuckn.net/docs/WshPolyfill/)\n- [WshUtil](https://tuckn.net/docs/WshUtil/)\n- [WshPath](https://tuckn.net/docs/WshPath/)\n- [WshOS](https://tuckn.net/docs/WshOS/)\n- [WshFileSystem](https://tuckn.net/docs/WshFileSystem/)\n- [WshProcess](https://tuckn.net/docs/WshProcess/)\n- [WshChildProcess](https://tuckn.net/docs/WshChildProcess/)\n- [WshNet](https://tuckn.net/docs/WshNet/)\n- [WshZLIB](https://tuckn.net/docs/WshZLIB/)\n\n## Upper Layer Modules\n\nPlease also refer to the more convenient upper-layer modules that use WshModeJs.\n\n- [WshCommander](https://github.com/tuckn/WshCommander)\n- [WshConfigStore](https://github.com/tuckn/WshConfigStore)\n- [WshDotEnv](https://github.com/tuckn/WshDotEnv)\n- [WshLogger](https://github.com/tuckn/WshLogger)\n\nIn addition, [WshBasicApps](https://github.com/tuckn/WshBasicPackage) can use all the above modules.\n\n## License\n\nMIT\n\nCopyright (c) 2020 [Tuckn](https://github.com/tuckn)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuckn%2Fwshmodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftuckn%2Fwshmodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftuckn%2Fwshmodejs/lists"}