Package Exports
- @bedrock/jsonld-document-loader
- @bedrock/jsonld-document-loader/lib/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@bedrock/jsonld-document-loader) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
JSON-LD Document Loader (bedrock-jsonld-document-loader)
A document loader API for jsonld.js and the Bedrock ecosystem.
Table of Contents
Background
TBD
Security
TBD
Install
- Node.js 14+ is required.
NPM
To install via NPM:
npm install --save @bedrock/jsonld-document-loaderDevelopment
To install locally (for development):
git clone https://github.com/digitalbazaar/bedrock-jsonld-document-loader.git
cd bedrock-jsonld-document-loader
npm installUsage
This library exports the following things:
- A
jsonLdDocumentLoaderinstance. - A default
documentLoaderfunction (with an instance bound to it). - An
httpClientHandler, for use withcfg.documentLoader.mode === 'web'.
import {documentLoader} from '@bedrock/jsonld-document-loader';Enabling the HTTP/HTTPS protocol handler
import * as bedrock from '@bedrock/core';
const {config: {'your-project': cfg}} = bedrock;
// Import the loader instance, and not the 'documentLoader' function directly.
import {jsonLdDocumentLoader, httpClientHandler} from
'@bedrock/jsonld-document-loader';
// if enabled, add loader for remote documents
if(cfg.documentLoader.mode === 'web') {
jsonLdDocumentLoader.setProtocolHandler({protocol: 'http', handler: httpClientHandler});
jsonLdDocumentLoader.setProtocolHandler({protocol: 'https', handler: httpClientHandler});
}
export const documentLoader = jsonLdDocumentLoader.build();Contribute
See the contribute file!
PRs accepted.
If editing the Readme, please conform to the standard-readme specification.
Commercial Support
Commercial support for this library is available upon request from Digital Bazaar: support@digitalbazaar.com
License
Bedrock Non-Commercial License v1.0 © Digital Bazaar