Last active
February 26, 2024 09:58
-
-
Save zaverden/4c0b4a7d5d4f68152a449b6b32a57822 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// nodejs v8.9.4 | |
// yarn add evernote@2.0.5 | |
const Evernote = require('evernote'); | |
const client = new Evernote.Client({ token: 'put-your-token-here', sandbox: false }); | |
const store = client.getNoteStore(); | |
process.on('uncaughtException', (err) => { | |
console.log({ source: 'uncaughtException', err }); | |
process.exit(1); | |
}); | |
process.on('unhandledRejection', (err) => { | |
console.log({ source: 'unhandledRejection', err }); | |
process.exit(1); | |
}); | |
console.log('before async call'); | |
try { | |
store.listNotebooks() | |
.then(() => console.log('success')) | |
.catch(() => console.log('handled async error')); | |
} catch(err) { | |
console.log('handled sync error'); | |
} | |
console.log('after async call'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment