co-poplib

0.0.1 • Public • Published

Promisify wrapper for poplib

Install

$ npm install co-poplib

Usage

var POP3Client = require('co-poplib');
var co = require('co');

co(function *() {
	var client = yield POP3Client(port, host, {
		ignoretlserrs: false,
		enabletls: true,
		debug: false
	});
	yield client.login(username, password);

	var list = yield client.list();

	if (list.length > 0) {
		var message = yield client.retr(1);
		yield client.dele(1);
	}
	yield client.quit();
})();

API

The API is the same as poplib's API.

If the success event emitted has a data argument, then data is returned, otherwise true is returned.

When one of the three error event emits, an Error will be thrown.

You can use client.raw.<API> to retrieve the rawdata argument of the success event instead of the data argument.

Package Sidebar

Install

npm i co-poplib

Weekly Downloads

1

Version

0.0.1

License

MIT

Last publish

Collaborators

  • nijiharatsubasa