jsonld-document-loader
Advanced tools
Comparing version 1.2.1 to 2.0.0
/*! | ||
* Copyright (c) 2019-2021 Digital Bazaar, Inc. All rights reserved. | ||
* Copyright (c) 2019-2023 Digital Bazaar, Inc. All rights reserved. | ||
*/ | ||
'use strict'; | ||
exports.JsonLdDocumentLoader = require('./JsonLdDocumentLoader'); | ||
export {JsonLdDocumentLoader} from './JsonLdDocumentLoader.js'; |
/*! | ||
* Copyright (c) 2019-2022 Digital Bazaar, Inc. All rights reserved. | ||
* Copyright (c) 2019-2023 Digital Bazaar, Inc. All rights reserved. | ||
*/ | ||
'use strict'; | ||
class JsonLdDocumentLoader { | ||
export class JsonLdDocumentLoader { | ||
constructor() { | ||
@@ -29,5 +28,7 @@ this.documents = new Map(); | ||
* | ||
* @param {string} protocol - Protocol id, such as 'did', 'https', etc. | ||
* @param {{get: Function}} handler - Protocol handler object, exposes an | ||
* async `get({url})` method. | ||
* @param {object} options -The options to use. | ||
* @param {string} options.protocol - Protocol id, such as 'did', 'https', | ||
* etc. | ||
* @param {{get: Function}} options.handler - Protocol handler object, | ||
* exposes an async `get({url})` method. | ||
*/ | ||
@@ -45,3 +46,3 @@ setProtocolHandler({protocol, handler} = {}) { | ||
* as did-method-key and did-veres-one. (Exposes a `.method` property, | ||
* and a `.get()` function.) | ||
* and a `.get()` function). | ||
*/ | ||
@@ -100,3 +101,3 @@ setDidResolver(didResolver) { | ||
* | ||
* @returns {Function} | ||
* @returns {Function} - The self-contained `documentLoader` function. | ||
*/ | ||
@@ -114,3 +115,1 @@ build() { | ||
} | ||
module.exports = JsonLdDocumentLoader; |
{ | ||
"name": "jsonld-document-loader", | ||
"version": "1.2.1", | ||
"version": "2.0.0", | ||
"description": "A document loader API for jsonld.js.", | ||
"main": "lib", | ||
"type": "module", | ||
"main": "./lib/index.js", | ||
"files": [ | ||
"lib/" | ||
"lib/**/*.js" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/digitalbazaar/jsonld-document-loader.git" | ||
"url": "https://github.com/digitalbazaar/jsonld-document-loader" | ||
}, | ||
@@ -25,33 +26,32 @@ "license": "BSD-3-Clause", | ||
"mocha": "mocha ./test/*.spec.js", | ||
"test": "npm run test-node", | ||
"test": "npm run test-node && npm run test-karma", | ||
"test-node": "cross-env NODE_ENV=test npm run mocha", | ||
"test-karma": "karma start karma.conf.js", | ||
"coverage": "cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text-summary npm run test-node", | ||
"coverage-ci": "cross-env NODE_ENV=test nyc --reporter=lcovonly npm run test-node", | ||
"coverage-report": "nyc report", | ||
"preversion": "npm test", | ||
"postversion": "git push --follow-tags", | ||
"test-karma": "karma start karma.conf.cjs", | ||
"coverage": "cross-env NODE_ENV=test c8 --reporter=lcov --reporter=text-summary npm run test-node", | ||
"coverage-ci": "cross-env NODE_ENV=test c8 --reporter=lcovonly npm run test-node", | ||
"coverage-report": "c8 report", | ||
"lint": "eslint ." | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@digitalbazaar/did-io": "^1.0.0", | ||
"chai": "^4.2.0", | ||
"cross-env": "^7.0.2", | ||
"eslint": "^7.13.0", | ||
"eslint-config-digitalbazaar": "^2.6.1", | ||
"karma": "^5.2.3", | ||
"@digitalbazaar/did-io": "^2.0.0", | ||
"chai": "^4.3.7", | ||
"cross-env": "^7.0.3", | ||
"eslint": "^8.33.0", | ||
"eslint-config-digitalbazaar": "^4.2.0", | ||
"eslint-plugin-jsdoc": "^39.7.5", | ||
"eslint-plugin-unicorn": "^45.0.2", | ||
"karma": "^6.4.1", | ||
"karma-chai": "^0.1.0", | ||
"karma-chrome-launcher": "^3.1.0", | ||
"karma-chrome-launcher": "^3.1.1", | ||
"karma-mocha": "^2.0.1", | ||
"karma-mocha-reporter": "^2.2.5", | ||
"karma-sourcemap-loader": "^0.3.8", | ||
"karma-webpack": "^4.0.2", | ||
"mocha": "^6.1.4", | ||
"nyc": "^15.1.0", | ||
"webpack": "^4.0.0" | ||
"karma-webpack": "^5.0.0", | ||
"mocha": "^10.2.0", | ||
"c8": "^7.12.0", | ||
"webpack": "^5.75.0" | ||
}, | ||
"engines": { | ||
"node": ">=12" | ||
"node": ">=16" | ||
} | ||
} |
@@ -28,3 +28,3 @@ # JSON-LD Document Loader _(jsonld-document-loader)_ | ||
- Node.js 12+ is required. | ||
- Node.js >= 16 is required. | ||
@@ -53,4 +53,2 @@ ### NPM | ||
import {JsonLdDocumentLoader} from 'jsonld-document-loader'; | ||
// or | ||
const {JsonLdDocumentLoader} = require('jsonld-document-loader'); | ||
@@ -66,3 +64,3 @@ const loader = new JsonLdDocumentLoader(); | ||
For example, to add support for the DID Core context, the VC context, and crypto | ||
For example, to add support for the DID Core context, the VC context, and crypto | ||
suite specific contexts: | ||
@@ -69,0 +67,0 @@ |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Yes
10294
17
5
104
153