{"id":13447624,"url":"https://github.com/npm/read-cmd-shim","last_synced_at":"2025-04-08T03:19:59.382Z","repository":{"id":1310809,"uuid":"42144552","full_name":"npm/read-cmd-shim","owner":"npm","description":"Read the path a cmd-shim is pointing at. Acts like fs.readlink but for cmd-shims.","archived":false,"fork":false,"pushed_at":"2024-10-02T16:47:24.000Z","size":165,"stargazers_count":10,"open_issues_count":4,"forks_count":8,"subscribers_count":21,"default_branch":"main","last_synced_at":"2025-03-28T13:08:23.436Z","etag":null,"topics":["npm-cli"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/npm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-09-08T23:31:21.000Z","updated_at":"2024-09-25T15:13:36.000Z","dependencies_parsed_at":"2023-07-06T01:55:31.833Z","dependency_job_id":"fd50ead3-2b04-4c8e-95a4-eec6bfdf949a","html_url":"https://github.com/npm/read-cmd-shim","commit_stats":{"total_commits":64,"total_committers":7,"mean_commits":9.142857142857142,"dds":0.671875,"last_synced_commit":"ee2717e0bbb3fe8b2b9b10fbc5dc0dcd710d6ced"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npm%2Fread-cmd-shim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npm%2Fread-cmd-shim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npm%2Fread-cmd-shim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npm%2Fread-cmd-shim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/npm","download_url":"https://codeload.github.com/npm/read-cmd-shim/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247767239,"owners_count":20992548,"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":["npm-cli"],"created_at":"2024-07-31T05:01:22.750Z","updated_at":"2025-04-08T03:19:59.329Z","avatar_url":"https://github.com/npm.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# read-cmd-shim\n\nFigure out what a [`cmd-shim`](https://github.com/ForbesLindesay/cmd-shim)\nis pointing at.  This acts as the equivalent of\n[`fs.readlink`](https://nodejs.org/api/fs.html#fs_fs_readlink_path_callback).\n\n### Usage\n\n```\nconst readCmdShim = require('read-cmd-shim')\n\nreadCmdShim('/path/to/shim.cmd').then(destination =\u003e {\n  …\n})\n\nconst destination = readCmdShim.sync('/path/to/shim.cmd')\n```\n\n### readCmdShim(path) -\u003e Promise\n\nReads the `cmd-shim` located at `path` and resolves with the _relative_\npath that the shim points at. Consider this as roughly the equivalent of\n`fs.readlink`.\n\nThis can read both `.cmd` style that are run by the Windows Command Prompt\nand Powershell, and the kind without any extension that are used by Cygwin.\n\nThis can return errors that `fs.readFile` returns, except that they'll\ninclude a stack trace from where `readCmdShim` was called.  Plus it can\nreturn a special `ENOTASHIM` exception, when it can't find a cmd-shim in the\nfile referenced by `path`.  This should only happen if you pass in a\nnon-command shim.\n\n### readCmdShim.sync(path)\n\nSame as above but synchronous. Errors are thrown.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnpm%2Fread-cmd-shim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnpm%2Fread-cmd-shim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnpm%2Fread-cmd-shim/lists"}