{"id":17328949,"url":"https://github.com/vthibault/grf-loader","last_synced_at":"2025-04-14T17:32:22.213Z","repository":{"id":37901372,"uuid":"268348242","full_name":"vthibault/grf-loader","owner":"vthibault","description":"Library to load  and extract files from Ragnarok Online GRF files","archived":false,"fork":false,"pushed_at":"2023-01-06T08:13:24.000Z","size":1555,"stargazers_count":13,"open_issues_count":14,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-06T18:51:50.307Z","etag":null,"topics":["grf","grf-loader","grf-reader","ragnarokonline"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vthibault.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-31T19:22:27.000Z","updated_at":"2024-09-30T19:50:59.000Z","dependencies_parsed_at":"2023-02-05T16:46:52.170Z","dependency_job_id":null,"html_url":"https://github.com/vthibault/grf-loader","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vthibault%2Fgrf-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vthibault%2Fgrf-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vthibault%2Fgrf-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vthibault%2Fgrf-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vthibault","download_url":"https://codeload.github.com/vthibault/grf-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240236235,"owners_count":19769573,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["grf","grf-loader","grf-reader","ragnarokonline"],"created_at":"2024-10-15T14:25:40.994Z","updated_at":"2025-02-25T18:31:39.840Z","avatar_url":"https://github.com/vthibault.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GRF Loader\n\n**GRF** is an archive file format that support lossless data compression used on **Ragnarok Online** to store game assets. A GRF file may contain one or more files or directories that may have been compressed (deflate) and encrypted (variant of DES).\n\n[![roBrowser project](https://img.shields.io/badge/project-roBrowser-informational.svg)](https://github.com/vthibault/roBrowser) [![license: MIT](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT)\n![node](https://github.com/vthibault/grf-loader/workflows/node/badge.svg?branch=master) ![browser](https://github.com/vthibault/grf-loader/workflows/browser/badge.svg?branch=master) ![lint](https://github.com/vthibault/grf-loader/workflows/lint/badge.svg?branch=master)\n\n## About\n\n- Only supports GRF version 0x200.\n- It's working both on node and browser environments\n- Supports DES description.\n- Avoid bloating client/server memory _(by not loading the whole file into the RAM)_\n- Does not supports custom encryption\n\n## Installation\n\n```\nnpm install grf-loader\n```\n\n## Basic usage\n\n- Load a grf file on node.js\n- Load a grf from the browser\n- List all files content\n- Extract a file from the GRF\n\n### Load a grf file on node.js\n\n```ts\nimport {GrfNode} from 'grf-loader';\nimport {openSync} from 'path';\n\nconst fd = openSync('path/to/data.grf', 'r');\nconst grf = new GrfNode(fd);\n\n// Start parsing the grf.\nawait grf.load();\n```\n\n### Load a grf from the browser\n\n```ts\nimport {GrfBrowser} from 'grf-loader';\n\nconst blob = document.querySelector('input[type=\"file\"]').files[0];\nconst grf = new GrfBrowser(blob);\n\n// Start parsing the grf\nawait grf.load();\n```\n\n### List all files content\n\nOnce the GRF is loaded, it's possible to list all files included inside it\n\n```ts\ngrf.files.forEach((entry, path) =\u003e {\n  console.log(path);\n});\n```\n\n### Extract a file from the GRF\n\nOnce the GRF is loaded, it's possible to extract all files you need\n\n```ts\nconst {data, error} = await grf.getFile('data\\\\clientinfo.xml');\n\n// data is a Uint8Array data, so we transform it into text\nconst content = String.fromCharCode.apply(null, data);\nconsole.log(content);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvthibault%2Fgrf-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvthibault%2Fgrf-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvthibault%2Fgrf-loader/lists"}