accordproject / template-archive

Smart Legal Contracts & Templating System
https://accordproject.org/projects/cicero/
Apache License 2.0
280 stars 119 forks source link

Having problems using the Cicero Node.js API #663

Closed rfcmarques closed 3 years ago

rfcmarques commented 3 years ago

So I'm trying to use your Cicero Node.js API and I always end up having an error while trying to follow this guide.

When I try to get the template I get an error about this code line regarding the await command

const template = await Template.fromDirectory('./test/data/latedeliveryandpenalty');

Is there anything I can do to make this work?

dselman commented 3 years ago

I suspect it is because await can only be called from an async function.

This repl workspace may be useful: https://replit.com/@DanSelman/Cicero#index.js

rfcmarques commented 3 years ago

Thank you so much for your help, the problem is solved