Socket
Socket
Sign inDemoInstall

@things-factory/document-template-base

Package Overview
Dependencies
5
Maintainers
10
Versions
650
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @things-factory/document-template-base

Server module to generate document template by mapping data


Version published
Maintainers
10
Created

Readme

Source

document-template-base

Prerequisites

  • @things-factory/document-template-service

How to use

  1. install
    yarn add @things-factory/document-template-base
    
  2. run @things-factory/document-template-service
  3. add configuration into config.[production|development].js
      reportApiUrl: //document-template-service url(e.g. http://localhost:8888/rest/report/show_html)
    
  4. request report result
    • way 1. using template string
      import { reportString2html } from '@things-factory/document-template-base'
      
      ...
      
      const html = await reportString2html({
        reportTemplateString: reportXML,
        data: {} // object data
      })
      
      ...
      
    • way 2. using local template file path
      import { reportPath2html } from '@things-factory/document-template-base'
      
      ...
      
      const html = await reportPath2html({
        reportFilePath: reportFilePath,
        data: {} // object data
      })
      
      ...
      
    • way 3. using template file url
      import { reportUrl2html } from '@things-factory/document-template-base'
      
      ...
      
      const html = await reportUrl2html({
        reportUrl: reportURL,
        data: {} // object data
      })
      
      ...
      

FAQs

Last updated on 06 May 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc