argosy-client
Deprecated
Use argosy instead. This module is no longer maintained as a separate entity.
Consume micro-services.
Part of the Argosy family.
example
var http = query = service = match = client = // connect the client to the serviceclient // create a micro-service that gets weatherservice // use the service with argosy-clientclient // or create a convenience function using invoke.partialvar getWeather = clientinvoke // or use promises
api
var argosyClient =
client = argosyClient()
Create a new client object. The client
object is a stream intended to be connected (piped) to Argosy services
through any number of intermediary streams.
client.invoke(msg [, cb])
Invoke a service which implements the msg
pattern. Upon
completion, the callback cb
, if supplied, will be called with the result or error. The client.invoke
function also
returns a promise which will resolve or reject appropriately.
client.invoke.partial(partialMsg)
Return a function that represents a partial invocation. The function returned has the same signature as client.invoke
, but
when called, the msg
parameter will be merged with the partialMsg
parameter provided at the time the function was created.
Otherwise, the generated function behaves identically to client.invoke
.
testing
npm test [--dot | --spec] [--grep=pattern]
Specifying --dot
or --spec
will change the output from the default TAP style.
Specifying --grep
will only run the test files that match the given pattern.
coverage
npm run coverage [--html]
This will output a textual coverage report. Including --html
will also open
an HTML coverage report in the default browser.