{"id":19123020,"url":"https://github.com/digitalbazaar/jsonld-request","last_synced_at":"2025-05-05T18:28:50.755Z","repository":{"id":1348076,"uuid":"42330260","full_name":"digitalbazaar/jsonld-request","owner":"digitalbazaar","description":"LIbrary to load JSON-LD from stdin, URLs, or files.","archived":false,"fork":false,"pushed_at":"2023-09-26T20:22:00.000Z","size":66,"stargazers_count":43,"open_issues_count":3,"forks_count":8,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-04-19T11:08:28.888Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/digitalbazaar.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-09-11T20:19:31.000Z","updated_at":"2025-03-23T17:29:38.000Z","dependencies_parsed_at":"2024-06-19T00:12:47.041Z","dependency_job_id":"21a91c77-9be7-44a4-9ef8-5298cc15c32e","html_url":"https://github.com/digitalbazaar/jsonld-request","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalbazaar%2Fjsonld-request","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalbazaar%2Fjsonld-request/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalbazaar%2Fjsonld-request/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitalbazaar%2Fjsonld-request/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/digitalbazaar","download_url":"https://codeload.github.com/digitalbazaar/jsonld-request/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251808852,"owners_count":21647362,"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":[],"created_at":"2024-11-09T05:23:58.182Z","updated_at":"2025-05-05T18:28:50.733Z","avatar_url":"https://github.com/digitalbazaar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"jsonld-request\n==============\n\nIntroduction\n------------\n\nThis JavaScript [Node.js][] library is used to read data from stdin, URLs, or\nfiles and convert to [JSON-LD][] via [jsonld.js][]. It can process JSON-LD in\nJSON and RDFa in HTML and output JSON-LD.\n\n## Installation\n\n```\nnpm install jsonld-request\n```\n\n## Usage\n\nImport the main function:\n\n```js\nimport {jsonldRequest} from 'jsonld-request';\n```\n\nRead from stdin:\n\n```js\nconst {data} = await jsonldRequest('-');\n```\n\nRead from URL:\n\n```js\nconst {response, data} = await jsonldRequest('https://www.example.com/resource');\n```\n\nRead from file:\n\n```js\nconst {data} = await jsonldRequest('file.jsonld');\n```\n\nRead from URL with headers and agent:\n\n```js\nimport https from 'https';\n// use custom headers\nconst headers = {\n  Example: 'example'\n};\n// use an agent to avoid self-signed certificate errors\nconst agent = new https.Agent({rejectUnauthorized: false});\n\nconst {response, data} = await jsonldRequest('https://www.example.com/resource', {\n  headers, agent\n});\n```\n\nOptions include:\n- **base**: The document base. (default: auto-detect)\n- **encoding**: The data encoding. (default: utf8)\n- **dataType**: The data type as a media type or shorthand. (default:\n  auto-detect)\n- **headers**: Headers for the request. (default: `Accept`).\n- **agent**: An agent to use for HTTP/HTTPS requests. (default: none)\n- **allow**: Array of allowed loaders. (default: `['stdin', 'file', 'http',\n  'https']`)\n\nSee [`@digitalbazaar/http-client`](https://github.com/digitalbazaar/http-client)\nfor other options.\n\nSecurity Considerations\n-----------------------\n\n**WARNING**: This code can load from stdin and arbitrary file locations! It is\nintended to provide low level support for resource loading. Please make sure\nthe calling code sanitizes inputs to avoid security issues. Do not use this as\na plain [jsonld.js][] document loader without proper protections!\n\nThe `allow` option can assist in only enabling certain loaders.\n\nCommercial Support\n------------------\n\nCommercial support for this library is available upon request from\n[Digital Bazaar][]: support@digitalbazaar.com\n\nSource Code\n-----------\n\nhttps://github.com/digitalbazaar/jsonld-request\n\n[Digital Bazaar]: https://digitalbazaar.com/\n[JSON-LD]: https://json-ld.org/\n[Node.js]: https://nodejs.org/\n[RDFa]: http://www.w3.org/TR/rdfa-core/\n[json-ld.org]: https://github.com/json-ld/json-ld.org\n[jsonld.js]: https://github.com/digitalbazaar/jsonld.js\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalbazaar%2Fjsonld-request","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigitalbazaar%2Fjsonld-request","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitalbazaar%2Fjsonld-request/lists"}