Socket
Book a DemoInstallSign in
Socket

imap-parser

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

imap-parser

A parser for IMAP line based commands

latest
Source
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

imap-parser

IMAP command parser for use on both client and server. This is based on work in andris9/inbox and provides a parser for IMAP line based commands.

Build Status

Installation

$ npm install imap-parser

API

To create an instance of the line parser:

var Parser = require('imap-parser')
var parser = new Parser()

The parser is a writable & readable stream. Just pipe the data stream from the TCP connection in and read the parsed lines out as data events. Each data event contains an array with the parsed data for a line. String literals are also handled more or less automatically (see caviat in events).

Events

log

Is emitted with a string as its data. This string is the entire unparsed content of the line. It is useful for logging:

parser.on('log', function (line) {
  console.log('c: ' + line)
})

literal

Is emitted when the client is sending a literal to the server but is waiting for a command continuation request:

parser.on('literal', function () {
  connection.write('+ Ready for additional command text')
})

Licence

MIT

Keywords

IMAP

FAQs

Package last updated on 13 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts