@twin.org/standards-ld-contexts 0.0.3-next.9 → 0.9.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/examples.md CHANGED
@@ -1 +1,19 @@
1
- # @twin.org/standards-ld-contexts - Examples
1
+ # Standards LD Contexts Examples
2
+
3
+ These snippets show how to inspect bundled contexts and add them to the JSON-LD document cache.
4
+
5
+ ## Context Cache Helpers
6
+
7
+ ```typescript
8
+ import {
9
+ LD_CONTEXTS,
10
+ addAllContextsToDocumentCache,
11
+ addContextToDocumentCache
12
+ } from '@twin.org/standards-ld-contexts';
13
+
14
+ const contextCount = Object.keys(LD_CONTEXTS).length;
15
+ await addAllContextsToDocumentCache();
16
+ await addContextToDocumentCache('https://www.w3.org/ns/credentials/v2');
17
+
18
+ console.log(contextCount > 0); // true
19
+ ```
@@ -7,3 +7,5 @@ Add all the contexts to the document cache.
7
7
  ## Returns
8
8
 
9
9
  `Promise`\<`void`\>
10
+
11
+ A promise that resolves when all contexts have been added to the cache.
@@ -15,3 +15,9 @@ The URL of the context to add to the cache.
15
15
  ## Returns
16
16
 
17
17
  `Promise`\<`void`\>
18
+
19
+ A promise that resolves when the context has been added to the cache.
20
+
21
+ ## Throws
22
+
23
+ GeneralError if the context URL is not found in the known contexts map.
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@twin.org/standards-ld-contexts",
3
- "version": "0.0.3-next.9",
4
- "description": "Local copies of standard LD contexts which can be used for offline development",
3
+ "version": "0.9.0-next.1",
4
+ "description": "Local JSON-LD contexts for offline and controlled use.",
5
5
  "repository": {
6
6
  "type": "git",
7
- "url": "git+https://github.com/twinfoundation/standards.git",
7
+ "url": "git+https://github.com/iotaledger/twin-standards.git",
8
8
  "directory": "packages/standards-ld-contexts"
9
9
  },
10
10
  "author": "cornel.filip@iota.org",
@@ -14,8 +14,8 @@
14
14
  "node": ">=20.0.0"
15
15
  },
16
16
  "dependencies": {
17
- "@twin.org/core": "next",
18
- "@twin.org/data-json-ld": "next"
17
+ "@twin.org/core": "0.9.0-next.1",
18
+ "@twin.org/data-json-ld": "0.9.0-next.1"
19
19
  },
20
20
  "main": "./dist/es/index.js",
21
21
  "types": "./dist/types/index.d.ts",
@@ -44,7 +44,7 @@
44
44
  "specification"
45
45
  ],
46
46
  "bugs": {
47
- "url": "git+https://github.com/twinfoundation/standards/issues"
47
+ "url": "git+https://github.com/iotaledger/twin-standards/issues"
48
48
  },
49
49
  "homepage": "https://twindev.org"
50
50
  }