forked from wearrrrr/curl-impersonate-node
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: update readme, exclude from prettier
- Loading branch information
1 parent
4b83300
commit 166c752
Showing
2 changed files
with
19 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
dist | ||
tests | ||
tests | ||
README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,36 @@ | ||
# node-curl-impersonate | ||
# ts-curl-impersonate | ||
|
||
Fork of [curl-impersonate-node](https://github.com/wearrrrr/curl-impersonate-node) that adds windows support. | ||
Fork of [curl-impersonate-node](https://github.com/wearrrrr/curl-impersonate-node) that adds windows support along with some other features. | ||
|
||
## Install | ||
|
||
```sh | ||
# yarn | ||
yarn add node-curl-impersonate | ||
yarn add ts-curl-impersonate | ||
|
||
# npm | ||
npm i node-curl-impersonate | ||
npm i ts-curl-impersonate | ||
``` | ||
|
||
## Usage | ||
|
||
```ts | ||
// normal request | ||
const response = await new RequestBuilder().url(/** YOUR URL HERE **/).header("x-foo-bar", "baz").send(); | ||
const response = await new RequestBuilder() | ||
.url(/** YOUR URL HERE **/) | ||
.header("x-foo-bar", "baz") | ||
.send(); | ||
|
||
// make a post request | ||
const response = await new RequestBuilder().url(/** YOUR URL HERE **/).method("POST").body({ foo: "bar" }).send(); | ||
const response = await new RequestBuilder() | ||
.url(/** YOUR URL HERE **/) | ||
.method("POST") | ||
.body({ foo: "bar" }) | ||
.send(); | ||
|
||
// use a browser preset (options vary by platform) | ||
const response = await new RequestBuilder().url(/** YOUR URL HERE **/).preset({ name: "chrome", version: "110" }).send(); | ||
const response = await new RequestBuilder() | ||
.url(/** YOUR URL HERE **/) | ||
.preset({ name: "chrome", version: "110" }) | ||
.send(); | ||
``` |