Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
@cincel.digital/doc-convert-request
Advanced tools
HTTP client for @cincel.digital/doc-convert-plugin package
@cincel.digital/doc-convert-request is a package designed to connect with @cincel.digital/doc-convert-plugin, a Hapi plugin that converts documents to PDF. This package provides HTTP-related functionality for document conversion.
yarn add @cincel.digital/doc-convert-request
# or
npm i @cincel.digital/doc-convert-request
To use this package, you need to import the function http
from
@cincel.digital/doc-convert-request.
The http
function allows you to convert a file to PDF by sending an HTTP
POST request to the specified URL. The function takes two parameters: the URL
and the file to be converted.
import { request } from "@cincel.digital/doc-convert-request"
const upload =
const filepicker = document.getElementById("filepicker") as HTMLInputElement
filepicker.addEventListener("change", (event) => {
const file = event.target.files?.[0]
if (!file) return
request("http://example.com/convert", file)
.then((pdfFile) => {
return pdfFile
})
.catch((err) => {
console.error(err)
})
})
The downloadRawURL
function allows you to generate a download URL for a
PDF file. It takes a File object as input and returns a URL that can be used for
downloading the file.
import { request, downloadRawURL } from "@cincel.digital/doc-convert-request"
const filepicker = document.getElementById("filepicker") as HTMLInputElement
filepicker.addEventListener("change", (event) => {
const file = event.target.files?.[0]
if (!file) return
request("http://example.com/convert", file)
.then((pdfFile) => {
const downloadRawURL = downloadRawURL(pdfFile)
window.open(downloadRawURL, "_blank")
return pdfFile
})
.catch((err) => {
console.error(err)
})
})
Please note that the @cincel.digital/doc-convert-plugin plugin is required for the proper functioning of this package. Make sure to install and configure the plugin according to its documentation before using @cincel.digital/doc-convert-request.
FAQs
HTTP client for @cincel.digital/doc-convert-plugin package
The npm package @cincel.digital/doc-convert-request receives a total of 6 weekly downloads. As such, @cincel.digital/doc-convert-request popularity was classified as not popular.
We found that @cincel.digital/doc-convert-request demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
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.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.