parse-git-index
v2.1.0
Published
parse git index
Downloads
8
Readme
Parse Git Index
Parse git index file.
Install
npm i parse-git-index
How to use?
const {readFileSync} = require('fs');
const parse = require('parse-git-index');
const index = readFileSync('./.git/index');
parse(index);
// returns
({
header: {
signature: 'DIRC',
version: '0x2',
count: '0x1',
},
entries: [{
ctime: '0x5d8893b223ad1e53',
mtime: '0x5d8893b223ad1e53',
dev: '0xfd01',
ino: '0x8e850',
mode: '0x81a4',
uid: '0x3e8',
gid: '0x3e8',
fileSize: '0x9b',
objectId: '0xaa148880272ec1d0488346da70e2dad451e8d3bf',
filePathSize: '0xe',
filePath: '.eslintrc.json',
}],
});
License
MIT