Skip to content

Commit

Permalink
Merge pull request #105 from Fdawgs/refactor/then
Browse files Browse the repository at this point in the history
replace promise syntax with async await
  • Loading branch information
Fdawgs authored Jun 29, 2020
2 parents 9ffeccd + 96f561b commit 381aadc
Show file tree
Hide file tree
Showing 7 changed files with 430 additions and 635 deletions.
11 changes: 2 additions & 9 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,7 @@ module.exports = {
}
],
'prefer-destructuring': 'off',
'promise/always-return': 'off',
'promise/catch-or-return': [
'error',
{
allowThen: true
}
],
'promise/prefer-await-to-then': 'warn',
'promise/prefer-await-to-callbacks': 'warn'
'promise/prefer-await-to-callbacks': 'warn',
'promise/prefer-await-to-then': 'warn'
}
};
13 changes: 6 additions & 7 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
## Functions

<dl>
<dt><a href="#parseOptions">parseOptions(options, acceptedOptions, args)</a> ⇒ <code>Promise.&lt;(string|Error)&gt;</code></dt>
<dt><a href="#parseOptions">parseOptions(options, acceptedOptions)</a> ⇒ <code>Promise.&lt;(string|Error)&gt;</code></dt>
<dd><p>Check each option provided is valid and of the correct type.</p>
</dd>
</dl>
Expand Down Expand Up @@ -443,16 +443,15 @@ one PDF result file.

<a name="parseOptions"></a>

## parseOptions(options, acceptedOptions, args) ⇒ <code>Promise.&lt;(string\|Error)&gt;</code>
## parseOptions(options, acceptedOptions) ⇒ <code>Promise.&lt;(string\|Error)&gt;</code>

Check each option provided is valid and of the correct type.

**Kind**: global function
**Returns**: <code>Promise.&lt;(string\|Error)&gt;</code> - Promise of stdout string on resolve, or Error object on rejection.
**Author**: Frazer Smith

| Param | Type |
| --------------- | ------------------- |
| options | <code>object</code> |
| acceptedOptions | <code>object</code> |
| args | <code>Array</code> |
| Param | Type | Description |
| --------------- | ------------------- | ------------------------------------------------ |
| options | <code>object</code> | Object containing options to pass to binary. |
| acceptedOptions | <code>object</code> | Object containing options that a binary accepts. |
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![GitHub Release](https://img.shields.io/github/release/Fdawgs/node-poppler.svg)](https://github.com/Fdawgs/node-poppler/releases/latest/) [![npm version](https://img.shields.io/npm/v/node-poppler)](https://www.npmjs.com/package/node-poppler)
[![Build Status](https://travis-ci.org/Fdawgs/node-poppler.svg?branch=master)](https://travis-ci.org/Fdawgs/node-poppler) [![Coverage Status](https://coveralls.io/repos/github/Fdawgs/node-poppler/badge.svg?branch=master)](https://coveralls.io/github/Fdawgs/node-poppler?branch=master) [![Dependabot Status](https://api.dependabot.com/badges/status?host=github&identifier=214626138)](https://dependabot.com) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

> Promise-based node.js wrapper for the Poppler PDF rendering library
> Asynchronous node.js wrapper for the Poppler PDF rendering library
## Intro

Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"dupe-check": "yarn jsinspect ./src",
"jest": "jest src --coverage",
"lint": "eslint . --cache --ext js,jsx,ts,tsx",
"prettier": "prettier . --write --ignore-path .gitignore",
"prettier": "prettier . --write",
"test": "yarn lint && yarn test-only",
"test-coverage": "cross-env NODE_ENV=test jest --coverage --runInBand",
"test-only": "cross-env NODE_ENV=test jest --detectOpenHandles --runInBand"
Expand Down Expand Up @@ -61,5 +61,7 @@
"prettier": "2.0.5",
"typescript": "^3.9.5"
},
"dependencies": {}
"dependencies": {
"execa": "^4.0.2"
}
}
Loading

0 comments on commit 381aadc

Please sign in to comment.