{"id":28477310,"url":"https://github.com/wasabithumb/winsn","last_synced_at":"2026-05-08T14:07:00.823Z","repository":{"id":197941128,"uuid":"699811111","full_name":"WasabiThumb/winsn","owner":"WasabiThumb","description":"Windows Path Short Name for NodeJS","archived":false,"fork":false,"pushed_at":"2023-10-03T11:49:53.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-04T13:37:45.973Z","etag":null,"topics":["javascript","node-gyp","nodejs","shortpath","win32","windows"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WasabiThumb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-03T11:46:07.000Z","updated_at":"2025-04-25T22:31:16.000Z","dependencies_parsed_at":"2023-10-03T18:27:19.014Z","dependency_job_id":null,"html_url":"https://github.com/WasabiThumb/winsn","commit_stats":null,"previous_names":["wasabithumb/winsn"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/WasabiThumb/winsn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WasabiThumb%2Fwinsn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WasabiThumb%2Fwinsn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WasabiThumb%2Fwinsn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WasabiThumb%2Fwinsn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WasabiThumb","download_url":"https://codeload.github.com/WasabiThumb/winsn/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WasabiThumb%2Fwinsn/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273124782,"owners_count":25050124,"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","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["javascript","node-gyp","nodejs","shortpath","win32","windows"],"created_at":"2025-06-07T16:12:17.337Z","updated_at":"2026-05-08T14:06:55.782Z","avatar_url":"https://github.com/WasabiThumb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# winsn\nWindows Path Short Name ([GetShortPathNameW](https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getshortpathnamew)) for NodeJS\n\n## Usage\nConvert a long path name to short path name:\n```js\nconst shortName = require(\"winsn\");\nshortName(\"C:\\\\Program Files\"); // C:\\PROGRA~1\n```\n\nHandle non-Windows OS:\n```js\nconst shortName = require(\"winsn\");\nif (shortName.isAvailable()) {\n    shortName(\"C:\\\\Program Files (x86)\"); // C:\\PROGRA~2\n}\n```\n\nHandle potentially invalid long path name:\n```js\nconst shortName = require(\"winsn\");\nconst long = \"Q:\\\\nonexistent\";\nlet short;\n\nshort = shortName.elseNull(long); // null (all host machines!)\nconsole.log(`${long} -\u003e ${short}`); // Q:\\nonexistent -\u003e null\n\nshort = shortName.elseLong(long); // Q:\\nonexistent\nconsole.log(`${long} -\u003e ${short}`); // Q:\\nonexistent -\u003e Q:\\nonexistent\n```\n\n## Why\n- Flexibility in cross-platform toolkits that assume unix-like paths where no whitespace or quotes are allowed\n- Reduce console clutter\n- 🤷\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwasabithumb%2Fwinsn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwasabithumb%2Fwinsn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwasabithumb%2Fwinsn/lists"}