node-note
v0.2.0
Published
Evernote wrapper
Downloads
5
Readme
node-note
Evernote wrapper.
Install
$ npm install --save node-note
Configuration
You need Evernote API Key and config.json
, like this.
{
"develop": {
"token": "DEVELOPER_TOKEN_FOR_SANDBOX"
},
"production": {
"token": "DEVELOPER_TOKEN_FOR_PRODUCTION"
}
}
Usage
var config = require('./config.json');
var nodeNote = require('node-note');
var evernote = new nodeNote({token: config.develop.token, sandbox: true});
// Create new note
var options = {
title: 'New Note created by node-note',
body: 'Here is the Evernote logo',
file: './ev-logo.png'
}
evernote.createNote(options, function (createdNote) {
console.log('Create new note ' + createdNote.guid);
});
// Delete note
var options = {
title: 'note title'
}
evernote.deleteNote(options, function (deletedNote) {
console.log('Delete note ' + deletedNote.guid);
});
API
evernote.createNote(options, callback)
Create new note.
options
title
Required
Type: String
Note title.
body
Type: String
Note body.
notebookName
Type: String
Notebook name of target.
file
Type: String
Attachement file.
tag
Type: Array
List of the tag name.
author
Type: String
The author of the content of the note.
url
Type: String
The original location where the resource was hosted.
width
Type: String
ex: 500px
Centering note contents by width
value.
callback(createdNote)
Type: Function
createdNote
Type: Object
Return created note. Represents a single note in the user's account.
evernote.deleteNote(options, callback)
Delete note.
options
Required title
or guid
field.
If you can set both field, set both field.
title
Type: String
Note title.
guid
Type: String
Note guid.
callback(deletedNote)
Type: Function
deletedNote
Type: Object
Return deleted note. Represents a single note in the user's account.
evernote.getNoteMetadata(options, callback)
Get note metadata.
options
word
Type: String
If present, a search query string that will filter the set of notes to be returned.
maxNotes
Type: Number
The mximum notes to return in this query.
callback(noteMetadataList)
Type: Function
noteMetadataList
Type: List
Return the metadata list of notes that match the criteria.
evernote.getNote(options, callback)
Get note.
options
guid
Required
Type: String
The GUID of the note to be retrieved.
withContent
Type: Bool
If true, the note will include the ENML contents of its 'content' field.
withRecouce
Type: Bool
If true, any Resource elements in this Note will include the binary contents of their 'data' field's body.
callback(note)
Type: Function
note
Type: Object
Returns the current state of the note in the service.
evenote.restoreNote(options, callback)
Restore note in trash.
options
Required title
or guid
field.
If you can set both field, set both field.
title
Type: String
note's title.
guid
Type: String
note's guid.
callback(restoredNote)
Type: Function
restoredNote
Type: Object
Return restored note.
evernote.updateNote(options, callback)
Submit a set of changes to a note to the service.
options
title
Required
Type: String
Note title.
newTitle
Type: String
New note title.
body
Type: String
Note body.
tag
Type: Array
List of the tag name.
width
Type: String
ex: 500px
Centering note contents by width
value.
callback(note)
Type: Function
note
Type: Object
Return the metadata (no contents) for the Note on the server after the update.
evernote.expungeNote(guid, callback)
Permanently removes a Note, and all of its Resources, from the service.
options
guid
Required
Type: String
Note guid.
callback(sequenceNum)
Type: Function
sequenceNum
Type: Number
The Update Sequence Number for this change within the account.
evernote.createNotebook(options, callback)
Create new notebook.
options
name
Required
Type: String
Notebook name.
callback(createdNotebook)
Type: Function
createdNotebook
Type: Object
evernote.expungeNotebook(guid, callback)
Permanently removes a Notebook from the service.
guid
Type: String
Note guid.
callback(sequenceNum)
Type: Function
sequencenum
Type: Number
The Update Sequence Number for this change within the account.
LICENSE
MIT