Package Exports
- node-csgo-parser
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (node-csgo-parser) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Node-CSGO-Parser
Extract Items/Skins/... from raw VDF data files
TODOs
- Generalization isDatasInitialized
- Better handle of Little Endian for vdf / Hack dependency
- Items image download (unique method)
- Generate technical unique id for each datas
- Retrieve Item Quality
- Datamining File for more informations
Installation
npm install node-csgo-parser --save
Usage
var parser = require('./csgo-data-parser'),
var schemaFilePath = './test/test-data/schema.txt',
langFilePath = './test/test-data/csgo_english.txt',
itemsFilePath = './test/test-data/items_game.txt',
outLogFilePath = './out/logs/parser.log';
var csgoDataParser = new parser(schemaFilePath, langFilePath, itemsFilePath, 'debug', outLogFilePath);
Must passing schema file (like schema.txt), language file (like csgo_english.txt) and item file (like item_data.txt) at VDF format
- Schema file can be find in
- Language file can be find in game data file (steam-data/csgo/resource/csgo_language.txt)
- Items File can be find both in game data file () and in
(Note : You need do get the items_game_url information)
Example
A sample script is at example.js
.
API Documentation
- CSGODataParser
- new CSGODataParser(schemaFilePath, langFilePath, itemsFilePath, logLevel, logFilePath)
- .getLogger() ⇒
winston.Logger
- .isDatasInitialized() ⇒
boolean
- .isLangInitialized() ⇒
boolean
- .getLangValue(keyLang) ⇒
String
- .getWeapons() ⇒
Array
- .getCollections() ⇒
Array
- .getExteriors() ⇒
Array
- .getCases() ⇒
Array
- .getCaseKeys() ⇒
Array
- .getStickers() ⇒
Array
- .getMusicKits() ⇒
Array
new CSGODataParser(schemaFilePath, langFilePath, itemsFilePath, logLevel, logFilePath)
Parser of CSGOData.
Param | Type | Description |
---|---|---|
schemaFilePath | String |
Path to schema file. |
langFilePath | String |
Path to csgo_lang file. |
itemsFilePath | String |
Path to items_game file. |
logLevel | String |
Winston Log Level, if > info no timing data for generations. |
logFilePath | String |
Choosen file path to write logs. |
csgoDataParser.getLogger() ⇒ winston.Logger
Return the parser's logger.
Kind: instance method of CSGODataParser
Returns: winston.Logger
- Winston based Parser's Logger.
Access: public
csgoDataParser.isDatasInitialized() ⇒ boolean
Check if datas files are OK.
Kind: instance method of CSGODataParser
Returns: boolean
- True if datas initialized, false otherwise
Access: public
csgoDataParser.isLangInitialized() ⇒ boolean
Check if lang file is OK.
Kind: instance method of CSGODataParser
Returns: boolean
- True if initialized, false otherwise
Access: public
csgoDataParser.getLangValue(keyLang) ⇒ String
Get the lang value from valve key i18n values.
Kind: instance method of CSGODataParser
Returns: String
- traduction if langfile initialized and key is present, key otherwise
Access: public
Param | Type | Description |
---|---|---|
keyLang | String |
valve key i18n values (like #PaintKit_aa_fade_Tag) |
csgoDataParser.getWeapons() ⇒ Array
Generate bases Weapons data from schema's data.
Kind: instance method of CSGODataParser
Returns: Array
- List of Objects. One object represent one Weapon.
Access: public
csgoDataParser.getCollections() ⇒ Array
Generate collection's data from itemsgame's data.
Kind: instance method of CSGODataParser
Returns: Array
- List of Objects. One object represent one Weapon.
Access: public
csgoDataParser.getExteriors() ⇒ Array
Generate exteriors.
Kind: instance method of CSGODataParser
Returns: Array
- List of String. One string represent one exterior type.
Access: public
csgoDataParser.getCases() ⇒ Array
Generate Weapon/Stickers skin Case list.
Kind: instance method of CSGODataParser
Returns: Array
- List of String. One string represent one case.
Access: public
csgoDataParser.getCaseKeys() ⇒ Array
Generate Weapon/Stickers skin Case keys list.
Kind: instance method of CSGODataParser
Returns: Array
- List of String. One string represent one case key.
Access: public
csgoDataParser.getStickers() ⇒ Array
Generate Stickers list.
Kind: instance method of CSGODataParser
Returns: Array
- List of String. One string represent one sticker.
Access: public
csgoDataParser.getMusicKits() ⇒ Array
Generate MusicKits list.
Kind: instance method of CSGODataParser
Returns: Array
- List of String. One string represent one music kit
Access: public