{"id":14384721,"url":"https://github.com/victorb/gx-js","last_synced_at":"2025-08-04T19:32:51.914Z","repository":{"id":148376878,"uuid":"64219156","full_name":"victorb/gx-js","owner":"victorb","description":"Immutable Package management for the JavaScript ecosystem using IPFS","archived":false,"fork":false,"pushed_at":"2018-01-07T10:26:29.000Z","size":9,"stargazers_count":16,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-28T13:58:26.455Z","etag":null,"topics":["decentralized","immutable","ipfs","javascript","package-manager","secure-by-default"],"latest_commit_sha":null,"homepage":"https://github.com/whyrusleeping/gx","language":"JavaScript","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/victorb.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-07-26T12:22:49.000Z","updated_at":"2024-05-30T11:14:12.000Z","dependencies_parsed_at":"2023-05-19T22:30:25.060Z","dependency_job_id":null,"html_url":"https://github.com/victorb/gx-js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/victorb/gx-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorb%2Fgx-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorb%2Fgx-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorb%2Fgx-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorb%2Fgx-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/victorb","download_url":"https://codeload.github.com/victorb/gx-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/victorb%2Fgx-js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268755809,"owners_count":24302838,"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","status":"online","status_checked_at":"2025-08-04T02:00:09.867Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["decentralized","immutable","ipfs","javascript","package-manager","secure-by-default"],"created_at":"2024-08-28T18:01:36.834Z","updated_at":"2025-08-04T19:32:51.863Z","avatar_url":"https://github.com/victorb.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# gx-js (WIP)\n\nFetch and publish JavaScript modules from/to IPFS\n\nJavaScript version of https://github.com/whyrusleeping/gx-go\n\n## Background\n\nInstead of fetching modules to a third-party, you can actually really simple host your\nown modules or ask other nodes to help rehost your modules.\n\nFetching the modules from IPFS rather than a centralized registry brings many\nbenefits to the ecosystem.\n\n- Low cost hosting\n- Easy replication and easy to setup private mirrors\n- Everyone can host packages\n- Caching can happen locally, in the local network or in a private network,\n  because of the P2P nature of IPFS.\n\nFor more information about GX itself, please check out the readme in https://github.com/whyrusleeping/gx\n\n\n## Requirements\n\n* NodeJS (5.11.1 or later)\n* npm (3.10.3 or later)\n* IPFS (0.4.2 or later) (https://ipfs.io)\n* gx (0.8.0 or later) (https://github.com/whyrusleeping/gx)\n\n## Installation\n\n`npm install -g gx-js`\n\n## Installing modules\n\n- First, setup your project to use gx-js with gx\n  - `gx init --lang js`\n- Import the package you want to use, we'll use a test library called \"gx-lib-a\"\n  - `gx import Qmd4bNLqHGxRgZhp6jrkisNCffDU3SwSd3XWj7ukendco2`\n- Now you should have a `node_modules/` directory with two directories inside it. It should look\n  something like this:\n\n```\nnode_modules\n├── gx\n│   └── ipfs\n│       └── Qmd4bNLqHGxRgZhp6jrkisNCffDU3SwSd3XWj7ukendco2\n│           └── gx-lib-a\n│               ├── index.js\n│               └── package.json\n└── gx-lib-a -\u003e /home/user/projects/victorbjelkholm/gx-root-package/node_modules/gx/ipfs/Qmd4bNLqHGxRgZhp6jrkisNCffDU3SwSd3XWj7ukendco2/gx-lib-a\n\n5 directories, 2 files\n```\n\nNow you can import from two paths, the first being much more secure but much more\ntearse. If you're dealing with multiple versions of the same library, you probably\nwant to use the first way as well.\n\n1. Require from `gx/ipfs`, using the full path\n\n```\nconst libAFromGX = require('gx/ipfs/Qmd4bNLqHGxRgZhp6jrkisNCffDU3SwSd3XWj7ukendco2/gx-lib-a')\nconsole.log(libAFromGX)\n```\n\n2. Require by using the module name only (might not work if multiple packages\n  use the same name)\n\n```\nconst libA = require('gx-lib-a')\nconsole.log(libA)\n```\n\n## Publishing modules\n\nTo publish modules, you will need to run a IPFS node locally, then you can\njust run `gx publish` and you get a hash that you can import in other projects.\n\n## Discovering modules\n\nCurrently, there is no handy mechanism for discovering modules. If you're a \nmodule publisher, you could include the version hash in the git tag or Github\nRelease.\n\n## License\n\nMIT 2016 (Victor Bjelkholm)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictorb%2Fgx-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvictorb%2Fgx-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictorb%2Fgx-js/lists"}