Skip to content

Commit

Permalink
chore: updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
dveldhoen committed Jan 30, 2024
1 parent 0543509 commit 862a7b2
Show file tree
Hide file tree
Showing 4 changed files with 222 additions and 160 deletions.
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,45 @@ easyinvoice.createInvoice(data, function (result) {

<br/>

## Error handling

Callback

```js
var easyinvoice = require('easyinvoice');

var data = {
apiKey: "free", // Please register to receive a production apiKey: https://app.budgetinvoice.com/register
mode: "development", // Production or development, defaults to production
};

easyinvoice.createInvoice(data, function (invoice) {
console.log(invoice);
}).catch((error) => {
// Handle the error
console.log(error);
});
```

Async/await

```js
var easyinvoice = require('easyinvoice');

var data = {
apiKey: "free", // Please register to receive a production apiKey: https://app.budgetinvoice.com/register
mode: "development", // Production or development, defaults to production
};

try {
const invoice = await easyinvoice.createInvoice(data);
console.log(invoice);
} catch (error) {
// Handle the error
console.log(error);
}
```

## Locales and Currency

Used for number formatting and the currency symbol:
Expand Down
2 changes: 1 addition & 1 deletion dist/easyinvoice.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/easyinvoice.min.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 862a7b2

Please sign in to comment.