1.1.5 • Published 7 months ago

@raabbajam/pluto-pdf v1.1.5

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

pluto-pdf

NPM version Build Status Coveralls Status Dependency Status Downloads

pluto-pdf

Install

npm i -S pluto-pdf

Usage

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(); // Promise

Use 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 -f

License

MIT © Raabb Ajam