Example:
const generate = require('agentdoc');
const options = {
// See below for options example
};
generate(options)
.then(...);
Note that the data
Object gets passed to Mustache to render the template with.
{
"type": "invoice",
"name": "Test Project",
"data": {
"title": "#420",
"payee": {
"name": "Some Person",
"email": "jason@nosaj.io"
},
"payer": {
"name": "Some Other Person",
"email": "human@graft.co"
},
"payment": {
"bank": "PiggyBank co",
"name": "MR Some Person",
"sortcode": "12-34-21",
"accountno": "12345678"
},
"work": [
{
"task": "Make sparkles",
"cost": 10
},
{
"task": "Bear Grooming (2 days)",
"cost": 400.30
},
{
"task": "Debrief (30 mins)",
"cost": 0.95
}
]
}
}