Socket
Socket
Sign inDemoInstall

@bedrock/jsonld-document-loader

Package Overview
Dependencies
209
Maintainers
5
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @bedrock/jsonld-document-loader

A document loader for jsonld.js.


Version published
Weekly downloads
117
decreased by-50.84%
Maintainers
5
Created
Weekly downloads
 

Changelog

Source

5.0.0 - 2024-03-17

Changed

  • BREAKING: Add fetch options with default size and timeout limits (16 KiB and 5 seconds, respectively) for httpHandlerClient.

Readme

Source

JSON-LD Document Loader (bedrock-jsonld-document-loader)

Build Status NPM Version

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-loader

Development

To install locally (for development):

git clone https://github.com/digitalbazaar/bedrock-jsonld-document-loader.git
cd bedrock-jsonld-document-loader
npm install

Usage

This library exports the following things:

  1. A jsonLdDocumentLoader instance.
  2. A default documentLoader function (with an instance bound to it).
  3. An httpClientHandler, for use with cfg.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

Keywords

FAQs

Last updated on 17 Mar 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc