File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,31 @@ TypeScript Development Kit for ZeroLedger Protocol - A comprehensive cryptograph
2525npm install @zeroledger/vycrypt
2626```
2727
28+ ## Module Formats
29+
30+ This library supports both ** CommonJS** and ** ES Modules** formats for maximum compatibility:
31+
32+ - ** CommonJS** : For Node.js environments and bundlers that prefer CommonJS
33+ - ** ES Modules** : For modern bundlers and environments that support ES modules
34+
35+ The library automatically provides the appropriate format based on your import method:
36+
37+ ``` typescript
38+ // ES Modules (recommended for modern projects)
39+ import { encrypt , decrypt } from " @zeroledger/vycrypt" ;
40+
41+ // CommonJS (for legacy Node.js or specific bundler requirements)
42+ const { encrypt, decrypt } = require (" @zeroledger/vycrypt" );
43+ ```
44+
45+ ### Build Output
46+
47+ The library builds to two directories:
48+ - ` cjs/ ` - CommonJS format with ` .js ` files
49+ - ` esm/ ` - ES Modules format with ` .js ` files and ` package.json `
50+
51+ Both formats include TypeScript declaration files (` .d.ts ` ) for full type support.
52+
2853## API Reference
2954
3055### Encryption & Decryption
@@ -247,6 +272,25 @@ npm install
247272npm test
248273```
249274
275+ ### Building
276+
277+ To build both CommonJS and ES Module versions:
278+
279+ ``` bash
280+ npm run build
281+ ```
282+
283+ This creates:
284+ - ` cjs/ ` directory with CommonJS files
285+ - ` esm/ ` directory with ES Module files
286+ - TypeScript declaration files (` .d.ts ` ) for both formats
287+
288+ ### Type Checking
289+
290+ ``` bash
291+ npm run typecheck
292+ ```
293+
250294## License
251295
252296SEE LICENSE IN LICENSE
You can’t perform that action at this time.
0 commit comments