diff --git a/README.md b/README.md index f1aa2d43..43ddfe0e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # rendering-proxy +[![npm version](https://badge.fury.io/js/rendering-proxy.svg)](https://badge.fury.io/js/rendering-proxy) [![codecov](https://codecov.io/gh/kitsuyui/rendering-proxy/branch/main/graph/badge.svg?token=zX1IVwqQab)](https://codecov.io/gh/kitsuyui/rendering-proxy) [![test](https://github.com/kitsuyui/rendering-proxy/actions/workflows/test.yml/badge.svg)](https://github.com/kitsuyui/rendering-proxy/actions/workflows/test.yml) [![Docker Pulls](https://img.shields.io/docker/pulls/kitsuyui/rendering-proxy.svg)](https://hub.docker.com/r/kitsuyui/rendering-proxy/) @@ -15,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/ ... @@ -43,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 ...