download
raw
549 Bytes
'use strict';
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;

Xet Storage Details

Size:
549 Bytes
·
Xet hash:
91e30a3dcc7eedcb1ba6b9da7acf76c518262b8956c32cef9c28a43df5f8ee59

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.