signnow-promise
v1.0.1
Published
Converts signnow node sdk callback pattern to return promises.
Downloads
6
Readme
signnow-promise
Converts signnow node sdk callback pattern to return promises.
signnow vs signnow-promise
signnow
signnow.user.create({
first_name: 'John',
last_name: 'Wayne',
email:'[email protected]',
password:'yourpwd'
}, function(err, res) {
if (!err) {
console.log(`RESULTS: ${res}`);
} else {
console.log(`ERROR: ${err}`);
}
});
signnow-promise
async/await
try {
const res = await signnow.user.create({
first_name: 'John',
last_name: 'Wayne',
email:'[email protected]',
password:'yourpwd'
});
console.log(`RESULTS: ${res}`);
} catch (err) {
console.log(`ERROR: ${err}`);
}
then/catch
signnow.user.create({
first_name: 'John',
last_name: 'Wayne',
email:'[email protected]',
password:'yourpwd'
}).then(res => {
console.log(`RESULTS: ${res}`);
}).catch(err => {
console.log(`ERROR: ${err}`);
});
Install
npm install signnow-promise
Usage
const signnow = require('signnow-promise')({
credentials: 'ENCODED_CLIENT_CREDENTIALS',
production: false
});
To see full usage documentation, see the README.md for signnow.