mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 16:25:21 +00:00
Improved Readme to include ESM import
This commit is contained in:
26
README.md
26
README.md
@@ -122,15 +122,23 @@ This is a standard procedure: you would have to do it also without using this li
|
||||
|
||||
## Usage Examples
|
||||
|
||||
#### Folder Model
|
||||
Importing:
|
||||
|
||||
```typescript
|
||||
/**
|
||||
* Use `const { PKPass } = require("passkit-generator");`
|
||||
* for usage in CommonJS (Node.js)
|
||||
*/
|
||||
/** CommonJS **/
|
||||
const { PKPass } = require("passkit-generator");
|
||||
|
||||
/** Typescript **/
|
||||
import { PKPass } from "passkit-generator";
|
||||
|
||||
/** ESM **/
|
||||
import passkit from "passkit-generator";
|
||||
const PKPass = passkit.PKPass;
|
||||
```
|
||||
|
||||
### Folder Model
|
||||
|
||||
```typescript
|
||||
try {
|
||||
/** Each, but last, can be either a string or a Buffer. See API Documentation for more */
|
||||
const { wwdr, signerCert, signerKey, signerKeyPassphrase } = getCertificatesContentsSomehow();
|
||||
@@ -169,15 +177,9 @@ try {
|
||||
}
|
||||
```
|
||||
|
||||
#### Buffer Model
|
||||
### Buffer Model
|
||||
|
||||
```typescript
|
||||
/**
|
||||
* Use `const { PKPass } = require("passkit-generator");`
|
||||
* for usage in CommonJS (Node.js)
|
||||
*/
|
||||
import { PKPass } from "passkit-generator";
|
||||
|
||||
try {
|
||||
/** Each, but last, can be either a string or a Buffer. See API Documentation for more */
|
||||
const { wwdr, signerCert, signerKey, signerKeyPassphrase } = getCertificatesContentsSomehow();
|
||||
|
||||
Reference in New Issue
Block a user