signnow-promise

1.0.1 • Public • Published

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:'john@domain.com',
    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:'john@domain.com',
        password:'yourpwd'
    });
    console.log(`RESULTS: ${res}`);
} catch (err) {
    console.log(`ERROR: ${err}`);
}

then/catch

signnow.user.create({
    first_name: 'John',
    last_name: 'Wayne',
    email:'john@domain.com',
    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.

Dependencies (1)

Dev Dependencies (1)

Package Sidebar

Install

npm i signnow-promise

Weekly Downloads

8

Version

1.0.1

License

MIT

Unpacked Size

11 kB

Total Files

6

Last publish

Collaborators

  • gpian