Skip to content

Commit 1216c51

Browse files
committed
fix cli tool
1 parent aafbf3a commit 1216c51

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ curl 'http://localhost:3000/generate?source=https://google.com&timeout=10' > goo
4343
It also support for command-line interface, so you can convert easily to a PDF.
4444

4545
```bash
46-
npm install -g https://github.com/iamdual/html2pdf
46+
git clone https://github.com/iamdual/html2pdf && cd html2pdf
47+
npm install
48+
npm run build
49+
sudo npm link
4750
html2pdf '<!DOCTYPE html><strong>Hello world!</strong>' -o output.pdf
4851
html2pdf "https://www.google.com" --format A4 --timeout 10 -o google.pdf
4952
html2pdf ./example.html --format A4 --pageRanges 1 -o example.pdf

bin/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const panic = (message: string | NodeJS.ErrnoException) => {
5050
process.exit(1);
5151
};
5252

53-
let config = new Config();
53+
let config = new Config(argv);
5454

5555
// Check is source is an exiting file
5656
if (!config.isUrl && existsSync(argv.source)) {

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
{
22
"name": "@iamdual/html2pdf",
3-
"version": "1.1.0",
3+
"version": "1.2.0",
44
"description": "HTML to PDF converter",
55
"scripts": {
6-
"test": "npx tsc && mocha ./dist/test",
7-
"start": "npx tsc && node ./dist/src/rest-api",
8-
"clean": "rm -rf ./dist"
6+
"clean": "rm -rf ./dist",
7+
"prebuild": "npm run clean",
8+
"build": "npx tsc",
9+
"pretest": "npm run build",
10+
"test": "mocha ./dist/test",
11+
"prestart": "npm run build",
12+
"start": "node ./dist/src/rest-api"
913
},
1014
"bin": {
1115
"html2pdf": "./dist/bin/index.js"

0 commit comments

Comments
 (0)