npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ews-simple

v0.3.0

Published

This package gives you an API to simplify work with ExchageWebService.

Downloads

20

Readme

ews-simple

Introduction

This package is build on top of ews-javascript-api and makes performing EWS operations easier.

API

ClientBuilder

This builder should allow you to configure EWS service with the specified url and auth data.

Supported methods:

  1. withVersion (value: ClientVersion) - configures ews version (default value is ClientVersion.Exchange2013)
  2. withUser (value: string) - configures ews user name
  3. withPwd (value: string) - configures user pwd
  4. withUri (value: string) - configures ews server uri
  5. withToken (value: string) - configures user authorization token

Example

const service = new ClientBuilder()
  .withUser(`<EWS username>`)
  .withPwd(`<EWS user pwd>`)
  .build();

FindItemsResultBuilder

This builder should allow you to return search results using the specified input folder and query string.

Supported methods:

  1. withService (value: ews.ExchangeService) - allow set ews service to be linked to
  2. withFolder (value: FolderEnum) - allow to set ews folder to be looked into
  3. withTakeN (value: number) - allow to set the amount(default 1000) of items to be returned
  4. withOffset (value: number) - allow to set offset
  5. withOffsetBasePoint (value: 'start' | 'end') - allow to set base point(default start)
  6. withQueryString (value: string) - allow to set query string for search
  7. withMarkAsRead (value: boolean) - allow to set whether to mark letter as read or not
  8. withDelete (value: boolean) - allow to set whether do delete letter after read
  9. withGetRaw (value: boolean) - allow to set wherther to return raw items or parse them
  10. withSaveAttachments (value: boolean) - allow to set whether to download attachments or not
  11. withDownloadsFolder (value: string) - allow to set downloads folder for attachments(default is downloads)
  12. withRawBody (value: boolean)- allow to set whether to return raw body or parse it before return

Examples

Read (get Subject, Body and Received Date) 10 unread mails from Inbox

const items = await new FindItemsResultBuilder()
  .withService(service)
  .withFolder(FolderEnum.Inbox)
  .withQueryString('isread:false')
  .withTakeN(10)
  .execute();

Read (keep them raw) 10 read mails from Favorites

const items = await new FindItemsResultBuilder()
  .withService(service)
  .withFolder(FolderEnum.Favorites)
  .withQueryString('isread:true')
  .withGetRaw(true)
  .execute();

EmailMessageBuilder

This builder should allow you to send a email with the specified data.

  1. withService (value: ews.ExchangeService) - allow set ews service to be linked to
  2. withSubject (value: string) - allow to set message subject
  3. withBodyType (value: 'text' | 'htm;') - allow to set message body content type (default text)
  4. withBody (value: string) - allow to set message body content
  5. withTo (value: string[]) - allow to set a list of To recepients
  6. withСс (value: string[]) - allow to set a list of Сс recepients
  7. withFileAttachment (value: string) - allow to set path to file attachment

Examples

Send email
await new EmailMessageBuilder()
  .withService(service)
  .withSubject(<mail subject>)
  .withBodyType(ews.BodyType.HTML)
  .withBody(<mail body>)
  .withTo(<recepients list>)
  .execute();
Send email with file attachment
await new EmailMessageBuilder()
  .withService(service)
  .withSubject(<mail subject>)
  .withBodyType(ews.BodyType.Text)
  .withBody(<mail body>)
  .withTo(<recepients list>)
  .withFileAttachment(<file name>)
  .execute();