1.1.5 • Published 7 months ago
@raabbajam/pluto-pdf v1.1.5
pluto-pdf
pluto-pdf
Install
npm i -S pluto-pdfUsage
const {Client, Server} = require('pluto-pdf');
const client = Client({
serverUrl: 'localhost:3002',
auth: 's3cret',
storageOptions: {
serverUrl: 'localhost:3003',
auth: 'miracle-',
},
});
const html = '<html>...</html>';
const type = 'citilink'; // default: custom. Look folder src/modules
client.convert(html, type) // promise
.then((stream) => stream.pipe(writeStream));
const links = ['http://example.com/asd.pdf', 'http://example.com/asd2.pdf'];
client.merge(links) //
.then((stream) => stream.pipe(writeStream));
const server = Server({
port: 3005,
auth: 's3cret',
storageOptions: {
serverUrl: 'localhost:3003',
auth: 'miracle-',
},
});
server.start(); // Promise
server.stop(); // PromiseUse docker-compose
git clone git@gitlab.pondokprogrammer.com:pluto/pluto-pdf.git
cd pluto-pdf
cp sample.env .env
nano .env
docker-compose up -d --build && docker-compose logs -fLicense
MIT © Raabb Ajam