Skip to content

Commit 9c6b1c5

Browse files
author
Corey B
committed
docs(npm): update package readme for v1.2.0 did:web API
1 parent 151ffd3 commit 9c6b1c5

1 file changed

Lines changed: 51 additions & 16 deletions

File tree

lib/node-fdd/README.md

Lines changed: 51 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,68 @@
11
# @coreyburns/node-fdd
22

3-
The official CLI toolchain for composing, packing, and cryptographically signing Formatted Data Document (`.fdd`) layouts natively from your Node endpoint.
4-
5-
The `.fdd` MIME type is a zero-JS interactive document specification meant to replace visual-first static PDFs natively by routing HTML rendering via declarative logic rules binding Cryptographic VC Payloads directly to your canvas.
3+
Official CLI & API toolchain for the OpenFDD (`.fdd`) format — zero-dependency, Node 18+.
64

75
---
86

9-
## ⚡ Global Installation
7+
## Installation
8+
109
```bash
1110
npm install -g @coreyburns/node-fdd
1211
```
1312

14-
## 🛠 Operation Workflows
15-
The OpenFDD compiler requires you to merge standard HTML Templates with a Cryptographic Data Payload into a secure FDD Container.
13+
---
1614

17-
### 1. Generating & Packing an `.fdd` Context
18-
Wrap your immutable schema, an optional mutable tracking schema (like `user-notes.json`), and the presentation layout using `fdd-pack`.
15+
## CLI Commands
1916

2017
```bash
21-
fdd-pack template.html fdd-data.json user-notes.json output.fdd
18+
# Generate an Ed25519 keypair
19+
fdd-identity keygen [./outDir]
20+
21+
# Generate a did.json for /.well-known/did.json hosting
22+
fdd-identity did <public.pem> <domain>
23+
24+
# Pack + sign an .fdd container in one step
25+
fdd-sign pack <template.html> <data.json> <private.pem> <did:web:domain> [output.fdd]
26+
27+
# Extract structured data from an .fdd (no OCR, no DOM)
28+
fdd-sign parse <file.fdd>
29+
30+
# Verify an .fdd signature against its did:web issuer
31+
fdd-sign verify <file.fdd>
32+
33+
# Legacy: sign a raw JSON file only
34+
fdd-sign sign <data.json> <private.pem> [output.json]
35+
36+
# Legacy: pack without signing
37+
fdd-pack <template.html> <data.json> [mutable.json] [output.fdd]
2238
```
2339

24-
### 2. Cryptographic Binding (Issuing)
25-
Officially binding a document enforces an Ed25519 trace mathematically tied to the JSON tree to ensure massive Verifiable Credential integrity mathematically.
40+
---
2641

27-
```bash
28-
fdd-sign path/to/privateKey.pem fdd-data.json
42+
## API — did:web Workflow
43+
44+
```javascript
45+
import { generateIdentity, createDidDocument } from '@coreyburns/node-fdd/identity';
46+
import { signFdd, parse, verify } from '@coreyburns/node-fdd';
47+
48+
// 1. One-time setup
49+
const identity = generateIdentity();
50+
const didDoc = createDidDocument(identity.publicKeyBase64, 'bank.com');
51+
// Host didDoc at https://bank.com/.well-known/did.json
52+
53+
// 2. Issue a document
54+
const fddString = signFdd(transactionData, htmlTemplate, identity.privateKeyPem, 'did:web:bank.com');
55+
56+
// 3. Consume (recipient server)
57+
const { valid, issuer } = await verify(fddString);
58+
if (valid) {
59+
const { vc, mutable } = parse(fddString);
60+
}
2961
```
3062

31-
## 🌍 Ecosystem Links
32-
* [OpenFDD Specification (GitHub)](https://github.com/Spuds0588/open-fdd)
33-
* [Read the Web Manifesto](https://spuds0588.github.io/open-fdd/site/index.html)
63+
---
64+
65+
## Ecosystem Links
66+
67+
- [OpenFDD Specification (GitHub)](https://github.com/Spuds0588/open-fdd)
68+
- [Web Manifesto](https://spuds0588.github.io/open-fdd/site/index.html)

0 commit comments

Comments
 (0)