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 ...