A snippet with different usage examples in NodObjC. Not all of this works but the concepts are mainly correct