From f5d7f3b775f3c1169564e2ea0b0156ed7690b9fb Mon Sep 17 00:00:00 2001 From: kitsuyui Date: Wed, 10 Aug 2022 05:48:11 +0900 Subject: [PATCH] Update usage and installation --- README.md | 40 ++++++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ce38e0b4..43ddfe0e 100644 --- a/README.md +++ b/README.md @@ -16,22 +16,50 @@ So this library provides simplicity in these cases: - Text browsers - Command line interface like curl wget +# Installation + +published on [npm](https://www.npmjs.com/package/rendering-proxy) + +```sh +$ npm install rendering-proxy +``` + +```sh +$ yarn add rendering-proxy +``` + # Usage -## Server mode +```console +$ rendering-proxy --help +rendering-proxy + +Commands: + rendering-proxy cli [url] CLi mode + rendering-proxy server Server mode + +Options: + --version Show version number [boolean] + --help Show help [boolean] +``` + +## CLI mode ```console -$ docker run -d -p 8080:8080 kitsuyui/rendering-proxy -$ curl localhost:8080/https://example.com/ +$ yarn run rendering-proxy cli https://example.com/ ... ``` -## CLI mode +## Server mode + +```console +$ yarn run rendering-proxy server --port=8080 +``` ```console -$ docker run --rm kitsuyui/rendering-proxy cli https://example.com/ +$ curl http://localhost:8080/https://example.com/ ... @@ -44,7 +72,7 @@ $ docker run --rm kitsuyui/rendering-proxy cli https://example.com/ When `-e`, `--evaluate` is specified, JavaScript code is evaluated before getting DOM. ```console -$ yarn ts-node src/main.ts cli https://example.com/ -e 'document.title = "updated"' -e 'document.title += " twice"' +$ yarn run rendering-proxy cli https://example.com/ -e 'document.title = "updated"' -e 'document.title += " twice"' updated twice ...