0.0.1 • Published 8 years ago

@fcrick/tes-data v0.0.1

Weekly downloads
-
License
Unlicense
Repository
github
Last release
8 years ago

Installation

npm install tes-data --save

Example

import * as tesData from '@fcrick/tes-data';
import fs = require('fs');

var path = 'C:/Program Files (x86)/Steam/steamapps/common/Skyrim/Data/Skyrim.esm';

fs.open(path, 'r', (err, fd) => {
  tesData.getRecordOffsets(fd, 0, (err, offsetPairs) => {
    tesData.getRecordBuffer(fd, offsetPairs[0][0], (err, buffer) => {
      console.log(JSON.stringify(tesData.getRecord(buffer), null, 2));
      fs.close(fd);
    });
  });
});

output

{
  "recordType": "TES4",
  "size": 44,
  "flags": 129,
  "version": 40,
  "subRecords": [
    {
      "type": "HEDR",
      "size": 12,
      "version": 0.9399999976158142,
      "numRecords": 920184,
      "nextObjectId": 3986
    },
    {
      "type": "CNAM",
      "size": 10,
      "value": "mcarofano"
    },
    {
      "type": "INTV",
      "size": 4,
      "value": 75461
    }
  ]
}
0.0.1

8 years ago

0.0.0

8 years ago