Skip to content
David Smith edited this page Dec 29, 2025 · 11 revisions

Phantom.js Wiki

Welcome to the Phantom.js wiki! This wiki contains comprehensive documentation, examples, and best practices for using Phantom.js in Mirth Connect, Open Integration Engine (OIE), and BridgeLink environments.

Quick Navigation

What is Phantom.js?

Phantom.js is a lightweight helper library designed specifically for Mirth Connect, Open Integration Engine (OIE), and BridgeLink scripting environments. It provides:

  • 26 String Operations - Manipulation, transformation, and validation
  • 27 Number Operations - Mathematical operations, rounding, and validation
  • 15 JSON Operations - Parse, manipulate, and query JSON objects
  • 2 Base64 Operations - Encode and decode base64 strings
  • 5 XML Operations - Parse, stringify, query XML documents
  • 18 Map Operations - 5 map types (Channel, Global, Connector, Response, Configuration) with save/get/exists/delete methods
  • Consistent API - All operations follow the same pattern
  • Error Handling - Proper error handling with specific error messages
  • Silent by Default - No logging on normal operations

Key Features

Zero Dependencies - Pure JavaScript, no external libraries
OIE Optimized - Designed specifically for OPEN INTEGRATION ENGINE ✅ Comprehensive Testing - 186 tests covering all operations
Well Documented - Complete documentation with examples
Error Safe - Consistent error handling throughout
93 Total Functions - Comprehensive utility library

Version

Current Version: 0.1.3

Quick Start

// Copy phantom.js into your OIE code templates

// Use string operations directly (no initialization needed)
var result = phantom.strings.operation.trim("  hello  ");
// Output: "hello"

// Use number operations
var sum = phantom.numbers.operation.add(5, 3);
// Output: 8

// Use map operations
phantom.maps.channel.save("key", "value");
var value = phantom.maps.channel.get("key");
// Output: "value"

// Use JSON operations
var obj = phantom.json.operation.parse('{"name":"John","age":30}');
var name = phantom.json.operation.get(obj, "name");
// Output: "John"

// Use base64 operations
var encoded = phantom.base64.operation.encode("Hello World");
// Output: "SGVsbG8gV29ybGQ="
var decoded = phantom.base64.operation.decode(encoded);
// Output: "Hello World"

// Use XML operations
var xml = phantom.xml.operation.parse('<root><name>John</name></root>');
var name = phantom.xml.operation.get(xml, 'name');
// Output: "John"

Contributing

Found a bug or have a feature request? Please open an issue on the GitHub repository.

License

See the LICENSE file for details.


Next Steps: Check out the Getting Started guide to begin using Phantom.js in your projects.

Clone this wiki locally