libamf
An Action Message Format library for node.js.
Usage
Parser/Serializer
const libamf = ; const data = libamf;const int = libamf;
Server
const Server Service = ; { super'pizza'; this; this; this; } { message; } { const id = pizzaid; return status: 1 message: 'Order ' + id + ' has been cancelled successfully.'; } { return { ; }; } const server = ; // You can also just do thisserver; server;server;
You can stop services from enforcing the -service
suffix to the name by doing:
libamfServiceForceSuffix = false;
You can also allow any service method to be used without registration by doing:
libamfServiceRequireRegistration = false;
If you wish to return other values in your service methods, you can disable responding with return values using:
libamfServiceReturnResponses = false;
To write whole numbers as integers, use this:
libamfAMF3AssumeIntegers = true;
To disable the default homepage, use:
libamfServerDisableDefaultHome = true;
Client
const Client = ;const client = ; client;client;
SOL
const fs = ;const libamf = ; fs;
Supported types
AMF0
Type | Read | Write | Note |
---|---|---|---|
Null | ✔ | ✔ | |
Undefined | ✔ | ✔ | |
String | ✔ | ✔ | |
Long String | ✔ | ✔ | |
Number | ✔ | ✔ | |
Boolean | ✔ | ✔ | |
Reference | ✔ | ✔ | |
Strict Array | ✔ | ✔ | |
ECMA Array | ✔ | ✔ | |
Typed Object | ✔ | ✔ | |
Date | ✔ | ✔ | |
AVMPLUS | ✔ | ✔ | |
XML | ✔ | ✔ |
AMF3
Type | Read | Write | Note |
---|---|---|---|
Undefined | ✔ | ✔ | |
Null | ✔ | ✔ | |
String | ✔ | ✔ | |
Double | ✔ | ✔ | |
Integer | ✔ | ✔ | |
Boolean | ✔ | ✔ | |
Date | ✔ | ✔ | |
Array | ✔ | ✔ | |
Dictionary | ✔ | ✔ | |
Vector | ✔ | ✔ | |
Byte Array | ✔ | ✔ | |
Custom object | ✔ | ✔ | |
XML | ✔ | ✔ |
TODO
- Better documentation
- Better tests
- Better TODO