Carbone Cloud API Javascript SDK
The javascript SDK to use Carbone Cloud easily into your frontend (Angular, Vuejs, Svelte, React, Ember.js...).
Carbone is a document generator (PDF, DOCX, XLSX, ODT, PPTX, ODS, XML, CSV...) using templates and JSON data.
Learn more about the Carbone ecosystem.
Install
npm install --save carbone-sdk-js
or
yarn add carbone-sdk-js
Usage
import carboneSDK from "carbone-sdk-js";
const _carboneService = carboneSDK("eyJhbGc...");
const _template = document.getElementById("inputFile").files[0];
let _data = JSON.parse(document.getElementById("inputData").value);
_carboneService.render(_template, _data).then(({ content, name }) => {
});
Checkout an integration example.
Documentation
Build for production
To edit build options, look at the file "build.js" for more details.
$ npm run build
After running the command, the script is available on the folder "dist".
Run tests
Build the project
$ npm run build
To run all the tests:
$ npm run test
If you need to test the generation of templateId, you can use the nodejs main.js
to test the sha256 generation.
$ node ./tests/generate_template_id.js
🤝 Contributing
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Show your support
Give a ⭐️ if this project helped you!
👤 Author