{"id":20942342,"url":"https://github.com/unfoldingword-dev/node-resource-container","last_synced_at":"2026-04-29T02:04:05.311Z","repository":{"id":57146673,"uuid":"67065745","full_name":"unfoldingWord-dev/node-resource-container","owner":"unfoldingWord-dev","description":"A utility for managing Door43 Resource Containers","archived":false,"fork":false,"pushed_at":"2017-05-08T20:11:54.000Z","size":618,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-10-30T08:04:53.397Z","etag":null,"topics":["resource-container"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unfoldingWord-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-31T19:08:56.000Z","updated_at":"2017-03-07T23:45:06.000Z","dependencies_parsed_at":"2022-09-06T12:52:55.233Z","dependency_job_id":null,"html_url":"https://github.com/unfoldingWord-dev/node-resource-container","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unfoldingWord-dev%2Fnode-resource-container","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unfoldingWord-dev%2Fnode-resource-container/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unfoldingWord-dev%2Fnode-resource-container/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unfoldingWord-dev%2Fnode-resource-container/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unfoldingWord-dev","download_url":"https://codeload.github.com/unfoldingWord-dev/node-resource-container/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243335382,"owners_count":20274898,"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":["resource-container"],"created_at":"2024-11-18T23:26:12.044Z","updated_at":"2025-12-29T02:09:02.704Z","avatar_url":"https://github.com/unfoldingWord-dev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# resource-container\nA utility for managing Door43 Resource Containers. This follows the specification at http://resource-container.readthedocs.io/en/v0.1/.\n\nSpecifically, this library allows  you to interact with Resource Containers at an abstract level hiding most of the specification implementation.\n\n## Resource Containers\nA Resource Container is a modular/portable package of translation data.\n\n\u003e NOTE: v0.1 of the Resource Container specification includes a spec for a file extension.\n\u003e a **closed** Resource Container is a compressed archive with this extension.\n\u003e An **open** Resource Container is the un-compressed directory.\n\u003e Be sure to use the `open` and `close` methods as needed.\n\u003e The compression and consequently the file extension will be deprecated in v0.2 at which point\n\u003e clients will be responsible for extracting archives prior to using the resource-container library.\n\n## Installation\n```\nnpm install resource-container\n```\n\n## Usage\nThere are a number of different methods available. If you need a complete list read the source.\nFor the most part you'll be interested in the `load` method.\n\n```js\nlet rclib = require('resource-container');\n\n// just for fun... print the version of the resource container spec that is supported.\nconsole.log(rclib.tools.spec.version);\n\n// load an open container\nrclib.load('/path/to/resource/container/dir')\n    .then(function(container) {\n        // do stuff with your container!\n    });\n\n// open a compressed (closed) container\nrclib.open('/path/to/resource/container/archive.tsrc', '/output/container/dir')\n    .then(function(container) {\n        // do stuff with your container!\n    });\n```\n\nOnce you have your resource container object you can do all sorts of fun things\n\n```js\n// access language, project, resource info like the slug etc.\nconsole.log(container.language.slug);\nconsole.log(container.project.slug);\nconsole.log(container.resource.slug);\n\n// get chapter slugs (un-ordered). see toc for ordered.\nvar chapterSlugs = container.chapters();\n\n// get chunk slugs (un-ordered). see toc for ordered.\nvar chunkSlugs = container.chunks(chapterSlugs[0]);\n\n// read chunk data\nvar chunk = container.readChunk(chapterSlugs[0], chunkSlugs[0]);\n\n// TODO: we need need to support writing a chunk\n// container.writeChunk('01', '01', 'In the beginning...');\n\n// get the manifest\nvar manifest = container.info();\n\n// get the data configuration (map of associated data)\nvar config = contianer.config();\n\n// get the table of contents (for ordered chapters and chunks)\nvar toc = container.toc();\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funfoldingword-dev%2Fnode-resource-container","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funfoldingword-dev%2Fnode-resource-container","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funfoldingword-dev%2Fnode-resource-container/lists"}