Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Evernote = require('evernote');
- const noteID = 'b6401aaf-8b5d-491f-b9a3-18b6bac5840a'
- const token = '';
- const serviceHost = 'www.evernote.com.';
- const client = new Evernote.Client({ token, serviceHost });
- const noteStore = client.getNoteStore();
- const newContent = `
- <!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd">
- <en-note>
- <div>Updated Note</div>
- </en-note>
- `;
- (async () => {
- try {
- const note = await noteStore.getNote(noteID, true, true, true, true);
- console.log('Source content: ')
- console.log(note.content);
- note.content = newContent
- const updateDoc = {
- guid: noteID,
- title: note.title,
- content: newContent
- };
- await noteStore.updateNote(updateDoc)
- console.log('Updated content: ')
- const updateNote = await noteStore.getNote(noteID, true, true, true, true);
- console.log(updateNote.content);
- } catch (e) {
- console.log(e);
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement