1.1.0 • Published 5 years ago
destiny2-manifest-browser v1.1.0
destiny2-manifest-browser
this is a wip don't count on the methods not to change
i have good intentions but at the second it jsut downloads the whole manifest, fresh, and holds it in place to dole out entries
a simple (node!) class with functions to download and access the d2 manifest
// example.js
const D2Manifest = require('destiny2-manifest-browser').default;
const manifest = new D2Manifest('asdf');
await manifest.loadupdated();
//-> manifest loaded
manifest.get('DestinyInventoryItemDefinition', 460688465).displayProperties.description;
//-> "Mine is not a final shape. She showed me that." –Eris Morn
manifest.getAll('DestinyDamageTypeDefinition').length;
//-> 4
manifest.find('DestinyInventoryItemDefinition', 'orpheus')[0].displayProperties.name;
//-> 'Orpheus Rig'
i mainly wanted a simple way to pull pre-typed records from the manifest
this returns records with bungie-api-ts definitions
// example.ts
import D2Manifest from "destiny2-manifest";
// [...etc...]
const myItem = manifest.get('DestinyInventoryItemDefinition', 460688465);
myItem.icon;
// TypeScript error: Property 'icon' does not exist on type 'DestinyInventoryItemDefinition'.ts(2339)