-
Notifications
You must be signed in to change notification settings - Fork 1
2. Usage
greatlygravitate edited this page Nov 7, 2021
·
1 revision
To use it, you use the function get
and add a .then
statement to get the promise. For example:
get("https://google.com").then(data => {
console.log(data);
})
If you are accessing JSON and want to parse it, you use the json
function:
get("https://jsonplaceholder.typicode.com/todos/1").then(data => {
console.log(data.id); // getting undefined
data = json(data);
console.log(data.id); // getting 1
})
Discuss and share here: https://github.com/carrotscript/get-page/discussions
© Get-Page contributors. All rights reserved