Is there anyway to pipe/feed a string to dub instead of using the dub.json file?

The reason I am asking is because I'd like to use dub indirectly from another program and instead of saving the dub.json file to disk and then calling dub I'd rather (ideally) just pass the string directly into dub.

Cheers, Edwin