![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
exchange-test-server
Advanced tools
The test server that implement the EWS API
$ npm install --save exchange-test-server
server = new Server()
server.start {port: 3000}, ->
console.log 'server listen on localhost:3000'
Server = require 'exchange-test-server'
Builder = require 'libxmljs-builder'
http = require 'http'
NS =
NS_SOAP: 'soap'
NS_TYPES: 't'
NS_MESSAGES: 'm'
NAMESPACES:
soap: 'http://schemas.xmlsoap.org/soap/envelope/'
t: 'http://schemas.microsoft.com/exchange/services/2006/types'
m: 'http://schemas.microsoft.com/exchange/services/2006/messages'
[NS_T, NS_M] = [NS.NS_TYPES, NS.NS_MESSAGES]
class RequestConstructor
_build: (bodyCallback) ->
@builder = new Builder
@builder.defineNS NS.NAMESPACES
@builder.rootNS NS.NS_SOAP, 'Envelope', (builder) ->
builder.nodeNS NS.NS_SOAP, 'Body', bodyCallback
_buildAction: (action, callback) ->
@_build (builder) ->
builder.nodeNS NS_M, action, callback
buildFolderIds: (builder, folderIds) ->
folderIds = [folderIds] unless Array.isArray(folderIds)
builder.nodeNS NS_M, 'FolderIds', (builder) =>
@buildDistinguishFolderId(builder, folderId) for folderId in folderIds
buildDistinguishFolderId: (builder, folderId) ->
builder.nodeNS NS_T, 'DistinguishedFolderId', Id: folderId
class GetFolderRequest extends RequestConstructor
build: (folderIds) ->
@_buildAction 'GetFolder', (builder) =>
builder.nodeNS NS_M, 'FolderShape', (builder) ->
builder.nodeNS NS_T, 'BaseShape', 'Default'
@buildFolderIds(builder, folderIds)
dbPath = require('path').resolve(__dirname, 'data/db.sqlite')
server = new Server()
server.start dbPath: dbPath, ->
console.log 'server start'
config =
port: 3000, method: 'POST', path: '/EWS/Exchange.asmx'
headers: 'Content-Type': 'text/xml'
req = http.request config, (res) ->
console.log 'Done'
server.close()
req.end new GetFolderRequest().build('inbox').toString()
(Coming soon)
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using gulp.
Copyright (c) 2015 liuxiong. Licensed under the MIT license.
FAQs
The test server that implement the EWS API
The npm package exchange-test-server receives a total of 1 weekly downloads. As such, exchange-test-server popularity was classified as not popular.
We found that exchange-test-server demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.