Merge pull request #69 from sarawarnock/master

added Buffer Model to README
This commit is contained in:
Alexander Cerutti
2021-02-26 22:42:58 +01:00
committed by GitHub

View File

@@ -140,7 +140,9 @@ ___
<a name="usage_example"></a>
## Usage example
## Usage Example
#### Folder Model
```typescript
/**
@@ -180,6 +182,31 @@ try {
}
```
#### Buffer Model
```typescript
import { createPass, Pass } from "passkit-generator";
try {
const examplePass = await createPass({
model: {
"thumbnail": Buffer.from([ ... ]),
"icon": Buffer.from([ ... ]),
"pass.json": Buffer.from([ ... ]),
"it.lproj/pass.strings": Buffer.from([ ... ])
},
// The rest will be the same as above
...
});
} catch (err) {
doSomethingWithTheError(err);
}
```
For more complex usage examples, please refer to [examples](https://github.com/alexandercerutti/passkit-generator/tree/master/examples) folder.
___