Z User
phase7: MCP stdio smoke test (handshake + tools/list + get_roots 6:74) — 4/4 tests PASS
54a6341 Download node_modules/cross-spawn/lib/util/readShebang.js from bravesigma/quran-md-plugin: direct link, hf CLI and curl.
- Browser
- Download file 549 Bytes
-
https://huggingface.co/datasets/bravesigma/quran-md-plugin/resolve/main/node_modules/cross-spawn/lib/util/readShebang.js
- Command line
-
hf download hf://datasets/bravesigma/quran-md-plugin/node_modules/cross-spawn/lib/util/readShebang.js
-
curl -L -o readShebang.js https://huggingface.co/datasets/bravesigma/quran-md-plugin/resolve/main/node_modules/cross-spawn/lib/util/readShebang.js
549 Bytes
| ; | |
| const fs = require('fs'); | |
| const shebangCommand = require('shebang-command'); | |
| function readShebang(command) { | |
| // Read the first 150 bytes from the file | |
| const size = 150; | |
| const buffer = Buffer.alloc(size); | |
| let fd; | |
| try { | |
| fd = fs.openSync(command, 'r'); | |
| fs.readSync(fd, buffer, 0, size, 0); | |
| fs.closeSync(fd); | |
| } catch (e) { /* Empty */ } | |
| // Attempt to extract shebang (null is returned if not a shebang) | |
| return shebangCommand(buffer.toString()); | |
| } | |
| module.exports = readShebang; | |