@bmqube/xmlrpc
Version:
A pure TypeScript XML-RPC client and server. Forked from (https://github.com/baalexander/node-xmlrpc)
41 lines (40 loc) • 1.1 kB
JavaScript
// index.mts
import Client from "./client.mjs";
import Server from "./server.mjs";
import CustomType from "./customtype.mjs";
import dateFormatter, { DateFormatter as DateFormatterClass } from "./date_formatter.mjs";
/**
* Creates an XML-RPC client (HTTP).
*/
export function createClient(options) {
return new Client(options, false);
}
/**
* Creates an XML-RPC client (HTTPS).
*/
export function createSecureClient(options) {
return new Client(options, true);
}
/**
* Creates an XML-RPC server (HTTP).
*/
export function createServer(options, callback) {
return new Server(options, false, callback);
}
/**
* Creates an XML-RPC server (HTTPS).
*/
export function createSecureServer(options, callback) {
return new Server(options, true, callback);
}
// Re-exports for convenience
export { Client, Server, CustomType, dateFormatter, DateFormatterClass as DateFormatter };
// Default export mirroring the original CommonJS `xmlrpc` object
export default {
createClient,
createSecureClient,
createServer,
createSecureServer,
CustomType,
dateFormatter,
};