fix readme style

fork
Brian White 12 years ago
parent bb5d8c43ed
commit dfb729b140

@ -188,62 +188,62 @@ node-imap exposes one object: **ImapConnection**.
A message structure with multiple parts might look something like the following: A message structure with multiple parts might look something like the following:
```javascript ```javascript
[ { type: 'mixed' [ { type: 'mixed',
, params: { boundary: '000e0cd294e80dc84c0475bf339d' } params: { boundary: '000e0cd294e80dc84c0475bf339d' },
, disposition: null disposition: null,
, language: null language: null,
, location: null location: null
} },
, [ { type: 'alternative' [ { type: 'alternative',
, params: { boundary: '000e0cd294e80dc83c0475bf339b' } params: { boundary: '000e0cd294e80dc83c0475bf339b' },
, disposition: null disposition: null,
, language: null language: null
} },
, [ { partID: '1.1' [ { partID: '1.1',
, type: 'text' type: 'text',
, subtype: 'plain' subtype: 'plain',
, params: { charset: 'ISO-8859-1' } params: { charset: 'ISO-8859-1' },
, id: null id: null,
, description: null description: null,
, encoding: '7BIT' encoding: '7BIT',
, size: 935 size: 935,
, lines: 46 lines: 46,
, md5: null md5: null,
, disposition: null disposition: null,
, language: null language: null
} }
] ],
, [ { partID: '1.2' [ { partID: '1.2',
, type: 'text' type: 'text',
, subtype: 'html' subtype: 'html',
, params: { charset: 'ISO-8859-1' } params: { charset: 'ISO-8859-1' },
, id: null id: null,
, description: null description: null,
, encoding: 'QUOTED-PRINTABLE' encoding: 'QUOTED-PRINTABLE',
, size: 1962 size: 1962,
, lines: 33 lines: 33,
, md5: null md5: null,
, disposition: null disposition: null,
, language: null language: null
} }
] ]
] ],
, [ { partID: '2' [ { partID: '2',
, type: 'application' type: 'application',
, subtype: 'octet-stream' subtype: 'octet-stream',
, params: { name: 'somefile' } params: { name: 'somefile' },
, id: null id: null,
, description: null description: null,
, encoding: 'BASE64' encoding: 'BASE64',
, size: 98 size: 98,
, lines: null lines: null,
, md5: null md5: null,
, disposition: disposition:
{ type: 'attachment' { type: 'attachment',
, params: { filename: 'somefile' } params: { filename: 'somefile' }
} },
, language: null language: null,
, location: null location: null
} }
] ]
] ]
@ -255,18 +255,18 @@ Each message part is identified by a partID which is used when you want to fetch
The structure of a message with only one part will simply look something like this: The structure of a message with only one part will simply look something like this:
```javascript ```javascript
[ { partID: '1' [ { partID: '1',
, type: 'text' type: 'text',
, subtype: 'plain' subtype: 'plain',
, params: { charset: 'ISO-8859-1' } params: { charset: 'ISO-8859-1' },
, id: null id: null,
, description: null description: null,
, encoding: '7BIT' encoding: '7BIT',
, size: 935 size: 935,
, lines: 46 lines: 46,
, md5: null md5: null,
, disposition: null disposition: null,
, language: null language: null
} }
] ]
``` ```
@ -323,15 +323,15 @@ ImapConnection Properties
There should always be at least one entry (although the IMAP spec allows for more, it doesn't seem to be very common) in the personal namespace list, with a blank namespace prefix. Each property's array contains objects of the following format (with example values): There should always be at least one entry (although the IMAP spec allows for more, it doesn't seem to be very common) in the personal namespace list, with a blank namespace prefix. Each property's array contains objects of the following format (with example values):
```javascript ```javascript
{ prefix: '' // A string containing the prefix to use to access mailboxes in this namespace { prefix: '', // A string containing the prefix to use to access mailboxes in this namespace
, delimiter: '/' // A string containing the hierarchy delimiter for this namespace, or boolean false delimiter: '/', // A string containing the hierarchy delimiter for this namespace, or boolean false
// for a flat namespace with no hierarchy // for a flat namespace with no hierarchy
, extensions: [ // An array of namespace extensions supported by this namespace, or null if none extensions: [ // An array of namespace extensions supported by this namespace, or null if none
// are specified // are specified
{ name: 'X-FOO-BAR' // A string indicating the extension name { name: 'X-FOO-BAR', // A string indicating the extension name
, params: [ 'BAZ' ] // An array of strings containing the parameters for this extension, params: [ 'BAZ' ] // An array of strings containing the parameters for this extension,
// or null if none are specified // or null if none are specified
} }
] ]
} }
``` ```
@ -382,62 +382,62 @@ ImapConnection Functions
```javascript ```javascript
{ INBOX: // mailbox name { INBOX: // mailbox name
{ attribs: [] // mailbox attributes. An attribute of 'NOSELECT' indicates the mailbox cannot { attribs: [], // mailbox attributes. An attribute of 'NOSELECT' indicates the mailbox cannot
// be opened // be opened
, displayName: 'INBOX' // the UTF-7-decoded version of the mailbox name displayName: 'INBOX', // UTF-7-decoded version of the mailbox name
, delimiter: '/' // hierarchy delimiter for accessing this mailbox's direct children. delimiter: '/', // hierarchy delimiter for accessing this mailbox's direct children.
, children: null // an object containing another structure similar in format to this top level, children: null, // an object containing another structure similar in format to this top level,
// otherwise null if no children // otherwise null if no children
, parent: null // pointer to parent mailbox, null if at the top level parent: null // pointer to parent mailbox, null if at the top level
} },
, Work: Work:
{ attribs: [] { attribs: [],
, delimiter: '/' delimiter: '/',
, children: null children: null,
, parent: null parent: null
} },
, '[Gmail]': '[Gmail]':
{ attribs: [ 'NOSELECT' ] { attribs: [ 'NOSELECT' ],
, delimiter: '/' delimiter: '/',
, children: children:
{ 'All Mail': { 'All Mail':
{ attribs: [] { attribs: [],
, delimiter: '/' delimiter: '/',
, children: null children: null,
, parent: [Circular] parent: [Circular]
} },
, Drafts: Drafts:
{ attribs: [] { attribs: [],
, delimiter: '/' delimiter: '/',
, children: null children: null,
, parent: [Circular] parent: [Circular]
} },
, 'Sent Mail': 'Sent Mail':
{ attribs: [] { attribs: [],
, delimiter: '/' delimiter: '/',
, children: null children: null,
, parent: [Circular] parent: [Circular]
} },
, Spam: Spam:
{ attribs: [] { attribs: [],
, delimiter: '/' delimiter: '/',
, children: null children: null,
, parent: [Circular] parent: [Circular]
},
Starred:
{ attribs: [],
delimiter: '/',
children: null,
parent: [Circular]
},
Trash:
{ attribs: [],
delimiter: '/',
children: null,
parent: [Circular]
} }
, Starred: },
{ attribs: [] parent: null
, delimiter: '/'
, children: null
, parent: [Circular]
}
, Trash:
{ attribs: []
, delimiter: '/'
, children: null
, parent: [Circular]
}
}
, parent: null
} }
} }
``` ```
@ -552,35 +552,35 @@ ImapConnection Functions
Valid `options` are: Valid `options` are:
* **markSeen** - < _boolean_ > - Mark message(s) as read when fetched. **Default:** false * **markSeen** - < _boolean_ > - Mark message(s) as read when fetched. **Default:** false
* **struct** - < _boolean_ > - Fetch the message structure. **Default:** true * **struct** - < _boolean_ > - Fetch the message structure. **Default:** true
* **size** - < _boolean_ > - Fetch the RFC822 size. **Default:** false * **size** - < _boolean_ > - Fetch the RFC822 size. **Default:** false
`request` is an _object_ or an _array_ of _object_s with the following valid properties: `request` is an _object_ or an _array_ of _object_ with the following valid properties:
* **id** - < _mixed_ > - _integer_ or _string_ referencing a message part to use when retrieving headers and/or a body. **Default:** (root part/entire message) * **id** - < _mixed_ > - _integer_ or _string_ referencing a message part to use when retrieving headers and/or a body. **Default:** (root part/entire message)
* **headers** - < _mixed_ > - An _array_ of specific headers to retrieve, _boolean_ true to fetch all headers, or an _object_ of the form (**Default:** (no headers)): * **headers** - < _mixed_ > - An _array_ of specific headers to retrieve, _boolean_ true to fetch all headers, or an _object_ of the form (**Default:** (no headers)):
* **fields** - < _mixed_ > - An _array_ of specific headers to retrieve or _boolean_ true to fetch all headers. * **fields** - < _mixed_ > - An _array_ of specific headers to retrieve or _boolean_ true to fetch all headers.
* **parse** - < _boolean_ > - Parse headers? **Default:** true * **parse** - < _boolean_ > - Parse headers? **Default:** true
* **headersNot** - < _mixed_ > - An _array_ of specific headers to exclude or an _object_ of the form (**Default:** (no headers)): * **headersNot** - < _mixed_ > - An _array_ of specific headers to exclude or an _object_ of the form (**Default:** (no headers)):
* **fields** - < _mixed_ > - An _array_ of specific headers to exclude. * **fields** - < _mixed_ > - An _array_ of specific headers to exclude.
* **parse** - < _boolean_ > - Parse headers? **Default:** true * **parse** - < _boolean_ > - Parse headers? **Default:** true
* **body** - < _mixed_ > - _boolean_ true to fetch the body, or an _object_ with the following valid properties: * **body** - < _mixed_ > - _boolean_ true to fetch the body, or an _object_ with the following valid properties:
* **start** - < _integer_ > - Start retrieving the body at this byte number. * **start** - < _integer_ > - Start retrieving the body at this byte number.
* **length** - < _integer_ > - How many bytes to retrieve. * **length** - < _integer_ > - How many bytes to retrieve.
* **cb** - < _function_ > - A callback that is passed an _ImapFetch_ object. * **cb** - < _function_ > - A callback that is passed an _ImapFetch_ object.
`callback` has one parameter: < _Error_ >err. This is executed when all message retrievals are complete. `callback` has one parameter: < _Error_ >err. This is executed when all message retrievals are complete.

Loading…
Cancel
Save