Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

carbone-sdk-js

Package Overview
Dependencies
Maintainers
0
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

carbone-sdk-js

The javascript SDK to use Carbone Render easily

  • 1.2.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
85
decreased by-44.81%
Maintainers
0
Weekly downloads
 
Created
Source

Carbone Cloud API Javascript SDK

GitHub release (latest by date) Documentation

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";
  // SDK constructor, pass your private API key as the first argument
  const _carboneService = carboneSDK("eyJhbGc...");
  // Template from a file input OR template ID
  const _template = document.getElementById("inputFile").files[0];
  // Data from an input
  let _data = JSON.parse(document.getElementById("inputData").value);
  // Render the report from a template and a JSON Data
  _carboneService.render(_template, _data).then(({ content, name }) => {
    // name == report name as a String
    // content == report content as a Blob, it can be used to download the file
  });

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

FAQs

Package last updated on 11 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc