{"_id":"@blakearoberts/ldragon","_rev":"14-6d463bf9b15f418ef72d9e457d2b6b02","name":"@blakearoberts/ldragon","dist-tags":{"latest":"0.1.6"},"versions":{"0.1.0":{"name":"@blakearoberts/ldragon","version":"0.1.0","description":"Lexer/parser for League of Legends spell templates","author":{"name":"Blake Roberts"},"repository":{"type":"git","url":"git+https://github.com/blakearoberts/ldragon.git"},"keywords":["league","lol","riot","spell","template","parse","language","lexer","parser","typescript"],"license":"MIT","main":"lib/index","types":"lib/index.d.ts","scripts":{"build":"npx tsc","test":"npx nyc mocha"},"directories":{"lib":"./lib","src":"./src","test":"./test"},"dependencies":{"chevrotain":"^10.5.0","fnv-plus":"^1.3.1","xxhashjs":"^0.2.2"},"devDependencies":{"@types/chai":"^4.3.5","@types/fnv-plus":"^1.3.0","@types/mocha":"^10.0.1","@types/sinon":"^10.0.15","@types/xxhashjs":"^0.2.2","chai":"^4.3.7","mocha":"^10.2.0","nyc":"^15.1.0","sinon":"^15.2.0","ts-node":"^10.9.1","typescript":"^5.1.3"},"gitHead":"0fb8ba1a2992f04cf3a10b7f8f34079d6b4f8134","bugs":{"url":"https://github.com/blakearoberts/ldragon/issues"},"homepage":"https://github.com/blakearoberts/ldragon#readme","_id":"@blakearoberts/ldragon@0.1.0","_nodeVersion":"20.3.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-urWr7iiIdm6mtVe8WKBlO+BT7AlQ8LJeOrJeDc2IqUJm5xHRRv+g8LFjxVrDurn1ci0Kf7LZ2ajCXCJtJEff/A==","shasum":"c66ab15ec26db0bf34f77efade2b1f8f9fc463c0","tarball":"https://registry.npmjs.org/@blakearoberts/ldragon/-/ldragon-0.1.0.tgz","fileCount":35,"unpackedSize":117856,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC1MiJIFeskjdHCPvIGuxn1BSjwNBVJVyNLfhqAsz0zMgIgI2OpYtbKe5TjThFfETwTWHXR7OE06VO9wNVVlj5cQn4="}]},"_npmUser":{"name":"blakearoberts","email":"blaker2015@gmail.com"},"maintainers":[{"name":"blakearoberts","email":"blaker2015@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ldragon_0.1.0_1688151817961_0.8272340714588833"},"_hasShrinkwrap":false},"0.1.1":{"name":"@blakearoberts/ldragon","version":"0.1.1","description":"Lexer/parser for League of Legends spell templates","author":{"name":"Blake Roberts"},"repository":{"type":"git","url":"git+https://github.com/blakearoberts/ldragon.git"},"keywords":["league","lol","riot","spell","template","parse","language","lexer","parser","typescript"],"license":"MIT","main":"lib/index","types":"lib/index.d.ts","scripts":{"build":"npx tsc","test":"npx nyc mocha"},"directories":{"lib":"./lib","src":"./src","test":"./test"},"dependencies":{"chevrotain":"^10.5.0","fnv-plus":"^1.3.1","xxhashjs":"^0.2.2"},"devDependencies":{"@types/chai":"^4.3.5","@types/fnv-plus":"^1.3.0","@types/mocha":"^10.0.1","@types/sinon":"^10.0.15","@types/xxhashjs":"^0.2.2","chai":"^4.3.7","mocha":"^10.2.0","nyc":"^15.1.0","sinon":"^15.2.0","ts-node":"^10.9.1","typescript":"^5.1.3"},"gitHead":"885ffcc12b643980ef2ae471d398e8488c3bc3fb","bugs":{"url":"https://github.com/blakearoberts/ldragon/issues"},"homepage":"https://github.com/blakearoberts/ldragon#readme","_id":"@blakearoberts/ldragon@0.1.1","_nodeVersion":"20.3.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-5M/GaYOPG5klw7kUX5r+9UBRQNeQN4zGbbEiwmkAgywfpi0vrOPpxGjvE1dl2J4efYkmBDeRDMut4hVpb/3/vg==","shasum":"9df40965e64f581cf0662c434c44fe6752a937c2","tarball":"https://registry.npmjs.org/@blakearoberts/ldragon/-/ldragon-0.1.1.tgz","fileCount":35,"unpackedSize":118287,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFb2GNg+QbX0BmFtsrPmBP/fkUVjAFORPAbDq2G/6kevAiEA2hBMdAkTS1SQdirwl+oAmUa4Z8Kdt5LrqSSiTLbSoVs="}]},"_npmUser":{"name":"blakearoberts","email":"blaker2015@gmail.com"},"maintainers":[{"name":"blakearoberts","email":"blaker2015@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ldragon_0.1.1_1688247163113_0.09182106943933888"},"_hasShrinkwrap":false},"0.1.2":{"name":"@blakearoberts/ldragon","version":"0.1.2","description":"Lexer/parser for League of Legends spell templates","author":{"name":"Blake Roberts"},"repository":{"type":"git","url":"git+https://github.com/blakearoberts/ldragon.git"},"keywords":["league","lol","riot","spell","template","parse","language","lexer","parser","typescript"],"license":"MIT","main":"lib/index","types":"lib/index.d.ts","scripts":{"build":"npx tsc","test":"npx nyc mocha"},"directories":{"lib":"./lib","src":"./src","test":"./test"},"dependencies":{"chevrotain":"^10.5.0","fnv-plus":"^1.3.1","xxhashjs":"^0.2.2"},"devDependencies":{"@types/chai":"^4.3.5","@types/fnv-plus":"^1.3.0","@types/mocha":"^10.0.1","@types/sinon":"^10.0.15","@types/xxhashjs":"^0.2.2","chai":"^4.3.7","mocha":"^10.2.0","nyc":"^15.1.0","sinon":"^15.2.0","ts-node":"^10.9.1","typescript":"^5.1.3"},"gitHead":"9b4b16bcc77b81d84cea6e49a59049975faa83a0","bugs":{"url":"https://github.com/blakearoberts/ldragon/issues"},"homepage":"https://github.com/blakearoberts/ldragon#readme","_id":"@blakearoberts/ldragon@0.1.2","_nodeVersion":"20.3.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-r0K0APfjZ4WFXek92D1HCfBe+PWCsUGwFmnuS2uzDR9ICGPvJS1m9TysvGhN+he5Xiy8r+68yfZDhacmXY8/Jw==","shasum":"49398f5c68d406bcbd7306ca3f3cedf4f0d4a0dc","tarball":"https://registry.npmjs.org/@blakearoberts/ldragon/-/ldragon-0.1.2.tgz","fileCount":35,"unpackedSize":119167,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDOpJjhk9qegwkROtrlSqZBP5mCqjtRqJZ43o+unDeTuAiByz4m4CMyGBKeyBw0LhsZRFwjzzuySQEYhx1TpLsNN3w=="}]},"_npmUser":{"name":"blakearoberts","email":"blaker2015@gmail.com"},"maintainers":[{"name":"blakearoberts","email":"blaker2015@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ldragon_0.1.2_1688680173470_0.9252297581782618"},"_hasShrinkwrap":false},"0.1.3":{"name":"@blakearoberts/ldragon","version":"0.1.3","description":"Lexer/parser for League of Legends spell templates","author":{"name":"Blake Roberts"},"repository":{"type":"git","url":"git+https://github.com/blakearoberts/ldragon.git"},"keywords":["league","lol","riot","spell","template","parse","language","lexer","parser","typescript"],"license":"MIT","main":"lib/index","types":"lib/index.d.ts","scripts":{"build":"npx tsc","test":"npx nyc mocha"},"directories":{"lib":"./lib","src":"./src","test":"./test"},"dependencies":{"chevrotain":"^10.5.0","fnv-plus":"^1.3.1","xxhashjs":"^0.2.2"},"devDependencies":{"@types/chai":"^4.3.5","@types/fnv-plus":"^1.3.0","@types/mocha":"^10.0.1","@types/sinon":"^10.0.15","@types/xxhashjs":"^0.2.2","chai":"^4.3.7","mocha":"^10.2.0","nyc":"^15.1.0","sinon":"^15.2.0","ts-node":"^10.9.1","typescript":"^5.1.3"},"gitHead":"4b63b24985acd56652fcb8f2b59e0dc13c087f1e","bugs":{"url":"https://github.com/blakearoberts/ldragon/issues"},"homepage":"https://github.com/blakearoberts/ldragon#readme","_id":"@blakearoberts/ldragon@0.1.3","_nodeVersion":"20.3.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-oqSRE2TIeqSHs/WvIGB+hEycamKM3j0iFZThLUhDeU6NzEU/4mzdcK89Wb+aH1S+pzB3gVtAU5TCnq/Uf+0Zdg==","shasum":"c1701ba8a4377a18874f12500fe621db091f94e1","tarball":"https://registry.npmjs.org/@blakearoberts/ldragon/-/ldragon-0.1.3.tgz","fileCount":35,"unpackedSize":118506,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHsMCcLO+LtbYH6xS8If149Cfks7HEYX/kAQaVQfOrILAiEAnxN9LqDBMyyXp5NWPx/nYO1+3lUtKnQZJBznfuheIaM="}]},"_npmUser":{"name":"blakearoberts","email":"blaker2015@gmail.com"},"maintainers":[{"name":"blakearoberts","email":"blaker2015@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ldragon_0.1.3_1688685911348_0.21462826972982518"},"_hasShrinkwrap":false},"0.1.4":{"name":"@blakearoberts/ldragon","version":"0.1.4","description":"Lexer/parser for League of Legends spell templates","author":{"name":"Blake Roberts"},"repository":{"type":"git","url":"git+https://github.com/blakearoberts/ldragon.git"},"keywords":["league","lol","riot","spell","template","parse","language","lexer","parser","typescript"],"license":"MIT","main":"lib/index","types":"lib/index.d.ts","scripts":{"build":"npx tsc","test":"npx nyc mocha"},"directories":{"lib":"./lib","src":"./src","test":"./test"},"dependencies":{"chevrotain":"^10.5.0","fnv-plus":"^1.3.1","xxhashjs":"^0.2.2"},"devDependencies":{"@types/chai":"^4.3.5","@types/fnv-plus":"^1.3.0","@types/mocha":"^10.0.1","@types/sinon":"^10.0.15","@types/xxhashjs":"^0.2.2","chai":"^4.3.7","mocha":"^10.2.0","nyc":"^15.1.0","sinon":"^15.2.0","ts-node":"^10.9.1","typescript":"^5.1.3"},"gitHead":"cee31146871febc8708878d88cc519dac8b6d35c","bugs":{"url":"https://github.com/blakearoberts/ldragon/issues"},"homepage":"https://github.com/blakearoberts/ldragon#readme","_id":"@blakearoberts/ldragon@0.1.4","_nodeVersion":"20.4.0","_npmVersion":"9.7.2","dist":{"integrity":"sha512-8jCBOMZ2rwedWyEpqTIqwdZV5Ebrx7rRaw3e3286uboW0Y9ueeQQtcRxdoJq4rLYhjvG7pzxUhEuYENwl04dnQ==","shasum":"7b984000a61c395705a35393dbe7a29ed6ebb715","tarball":"https://registry.npmjs.org/@blakearoberts/ldragon/-/ldragon-0.1.4.tgz","fileCount":35,"unpackedSize":123384,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDm8SZ5Vm6cbLEVI7/BhdL2LNpE6uqYk49RAIB5WMjqJAiEAlJd6DPBmW++hKrQzGTtlfuriYX6gH0nAYEBuqClkxIc="}]},"_npmUser":{"name":"blakearoberts","email":"blaker2015@gmail.com"},"maintainers":[{"name":"blakearoberts","email":"blaker2015@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ldragon_0.1.4_1688837276147_0.6042286872344822"},"_hasShrinkwrap":false},"0.1.5":{"name":"@blakearoberts/ldragon","version":"0.1.5","description":"Lexer/parser for League of Legends spell templates","author":{"name":"Blake Roberts"},"repository":{"type":"git","url":"git+https://github.com/blakearoberts/ldragon.git"},"keywords":["league","lol","riot","spell","template","parse","language","lexer","parser","typescript"],"license":"MIT","main":"lib/index","types":"lib/index.d.ts","scripts":{"build":"npx tsc","test":"npx nyc mocha"},"directories":{"lib":"./lib","src":"./src","test":"./test"},"dependencies":{"chevrotain":"^10.5.0","fnv-plus":"^1.3.1","xxhashjs":"^0.2.2"},"devDependencies":{"@types/chai":"^4.3.5","@types/fnv-plus":"^1.3.0","@types/mocha":"^10.0.1","@types/sinon":"^10.0.15","@types/xxhashjs":"^0.2.2","chai":"^4.3.7","mocha":"^10.2.0","nyc":"^15.1.0","sinon":"^15.2.0","ts-node":"^10.9.1","typescript":"^5.1.3"},"gitHead":"6918915aae926a0835a6237cdcd34cd33154ff53","bugs":{"url":"https://github.com/blakearoberts/ldragon/issues"},"homepage":"https://github.com/blakearoberts/ldragon#readme","_id":"@blakearoberts/ldragon@0.1.5","_nodeVersion":"20.4.0","_npmVersion":"9.7.2","dist":{"integrity":"sha512-5B7XzKfzHtZhCpcyH5DxnCr7QtF07luXVE30UtF+jEza+j+LjcU8zGNnhrLFO1MVaGosy/NMtOMp5TonpnN8Ow==","shasum":"702da7679779f9086fd82f8ee14a785bf04f2ec6","tarball":"https://registry.npmjs.org/@blakearoberts/ldragon/-/ldragon-0.1.5.tgz","fileCount":35,"unpackedSize":128067,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDazvlqNPdmv9M7dXr/IzG4bsWvjT8+LyisK/ammp95jAiEAyP0fixcU7RUp7S2BSKtEc0cvdDnxNDQ7vmwvprgmpRA="}]},"_npmUser":{"name":"blakearoberts","email":"blaker2015@gmail.com"},"maintainers":[{"name":"blakearoberts","email":"blaker2015@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ldragon_0.1.5_1688840018944_0.9866608127041869"},"_hasShrinkwrap":false},"0.1.6":{"name":"@blakearoberts/ldragon","version":"0.1.6","description":"Lexer/parser for League of Legends spell templates","author":{"name":"Blake Roberts"},"repository":{"type":"git","url":"git+https://github.com/blakearoberts/ldragon.git"},"keywords":["league","lol","riot","spell","template","parse","language","lexer","parser","typescript"],"license":"MIT","main":"lib/index","types":"lib/index.d.ts","scripts":{"build":"npx tsc","test":"npx nyc mocha"},"directories":{"lib":"./lib","src":"./src","test":"./test"},"dependencies":{"chevrotain":"^10.5.0","fnv-plus":"^1.3.1","xxhashjs":"^0.2.2"},"devDependencies":{"@types/chai":"^4.3.5","@types/fnv-plus":"^1.3.0","@types/mocha":"^10.0.1","@types/sinon":"^10.0.15","@types/xxhashjs":"^0.2.2","chai":"^4.3.7","mocha":"^10.2.0","nyc":"^15.1.0","sinon":"^15.2.0","ts-node":"^10.9.1","typescript":"^5.1.3"},"gitHead":"790112677b3e61ae652e900795b9677110180966","bugs":{"url":"https://github.com/blakearoberts/ldragon/issues"},"homepage":"https://github.com/blakearoberts/ldragon#readme","_id":"@blakearoberts/ldragon@0.1.6","_nodeVersion":"20.4.0","_npmVersion":"9.7.2","dist":{"integrity":"sha512-jkKBeaT6wdnw+yPDI9ohUWSOlDPCSB95DxIBRlB+PaZkPmTA0008soqINFcLt431GsXB+vdR1li54HSKWwfvUg==","shasum":"832087395adf698d21b588b57974d12456f6aab9","tarball":"https://registry.npmjs.org/@blakearoberts/ldragon/-/ldragon-0.1.6.tgz","fileCount":35,"unpackedSize":130996,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/X3eOZ6TOtUgpytGe8V6guVLvFvBC1tpDNfQxbBG0GQIgcCzSVEjFg8XsNsfJ/agkPy3TaPg39i/B6EJF3QJU+tQ="}]},"_npmUser":{"name":"blakearoberts","email":"blaker2015@gmail.com"},"maintainers":[{"name":"blakearoberts","email":"blaker2015@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ldragon_0.1.6_1688845834571_0.9592748054809552"},"_hasShrinkwrap":false}},"time":{"created":"2023-06-30T01:07:37.070Z","0.1.7":"2023-06-30T01:07:37.384Z","modified":"2023-07-08T19:50:34.867Z","0.1.9":"2023-06-30T01:21:23.577Z","0.0.1":"2023-06-30T16:23:01.040Z","0.0.2":"2023-06-30T16:29:37.483Z","0.1.0":"2023-06-30T19:03:38.175Z","0.1.1":"2023-07-01T21:32:43.309Z","0.1.2":"2023-07-06T21:49:33.647Z","0.1.3":"2023-07-06T23:25:11.545Z","0.1.4":"2023-07-08T17:27:56.320Z","0.1.5":"2023-07-08T18:13:39.168Z","0.1.6":"2023-07-08T19:50:34.754Z"},"maintainers":[{"name":"blakearoberts","email":"blaker2015@gmail.com"}],"description":"Lexer/parser for League of Legends spell templates","homepage":"https://github.com/blakearoberts/ldragon#readme","keywords":["league","lol","riot","spell","template","parse","language","lexer","parser","typescript"],"repository":{"type":"git","url":"git+https://github.com/blakearoberts/ldragon.git"},"author":{"name":"Blake Roberts"},"bugs":{"url":"https://github.com/blakearoberts/ldragon/issues"},"license":"MIT","readme":"# LDragon\n\nLDragon uses [Chevrotain](https://chevrotain.io/) to define a lexer/parser capable of compiling a [League of Legends](https://www.leagueoflegends.com/) champion spell description template into an [abstract syntax tree (AST)](https://www.wikipedia.org/wiki/Abstract_syntax_tree).\n\nLDragon can run in the browser, checkout the live [demo](https://blakearoberts.github.io/ldragon/)!\n\n## Installation\n\n### [npm](https://www.npmjs.com/package/@blakearoberts/ldragon)\n\n```bash\nnpm install @blakearoberts/ldragon --save\n```\n\n## Getting Started\n\n```typescript\nimport { ChampionBin, FontConfig, visit } from '@blakearoberts/ldragon';\n\nconst f = async <T,>(url: string) => {\n  const response = await fetch(url, options)\n  if (!response.ok) {\n    throw new Error(response.statusText);\n  }\n  return (await response.json()) as T;\n}\n\nconst bin = await f<ChampionBin>(\n  'https://raw.communitydragon.org/latest/game/data/characters/aatrox/aatrox.bin.json');\n\nconst fontConfig = await f<FontConfig>(\n  'https://raw.communitydragon.org/latest/game/data/menu/main_en_us.stringtable.json');\n\nconst championId = 'Aatrox',\n  spellKey = 'Characters/Aatrox/Spells/AatroxPassiveAbility/AatroxPassive',\n  tooltip = fontConfig.entries['passive_aatroxpassive_tooltip'];\n\nconst ast = visit(championId, spellKey, bin, fontConfig, tooltip);\n\nconsole.log(ast);\n```\n\n## React Example\n\nCheckout the [example React app](./example/react/) for a simple way to render an LDragon AST to the DOM. This example is built into a static site and hosted via this project's [GitHub Pages](https://blakearoberts.github.io/ldragon/).\n\n## AST Nodes\n\nThe AST returned from parsing a spell is comprised of nodes with relationships demonstrated by the following directed acyclic graph:\n\n```mermaid\ngraph LR;\n  D[DescriptionNode]\n  TX[TextNode]\n  B[BreakNode]\n  EL[ElementNode]\n  EX[ExpressionNode]\n  TP[TemplateNode]\n\n  DV[DataValueIdentifier]\n  GC[GameCalculationIdentifier]\n  GM[GameCalculationModifiedIdentifier]\n  EF[EffectIdentifier]\n\n  C[ConstantValue]\n  A[AbilityLevelValue]\n  CL[CharLevelValue]\n  CB[CharLevelBreakpointsValue]\n\n  subgraph Nodes\n  D  --> TX & B & EL & EX & TP\n  EL --> TX & EX & TP\n  end\n\n  subgraph Identifiers\n  EX --> DV & GC & GM & EF\n  GC --> DV & EF\n  GM --> GC\n  end\n\n  subgraph Values\n  DV --> C & A\n  EF --> C & A\n  GC -- part --> C & A & CL & CB\n  GM -- multiplier --> C\n  end\n```\n\n## Contributing\n\nContributions are welcome! There are plenty of edge cases this library fails to parse. Issues and pull requests would be greatly appreciated!\n\nTo build and compile the TypeScript sources to JavaScript use:\n\n```bash\nnpm run build\n```\n\nTo run the unit tests use:\n\n```bash\nnpm test\n```\n\n## License\n\nThis project is licensed under the terms of the [MIT license](./LICENSE).\n","readmeFilename":"README.md"}