분류 Nodejs

node-fetch - Node.js에 대한 window.fetch

컨텐츠 정보

  • 조회 268 (작성일 )

본문

https://github.com/bitinn/node-fetch


fetch('https://github.com/')
    .then(res => res.text())
    .then(body => console.log(body));


fetch('https://api.github.com/users/github')
    .then(res => res.json())
    .then(json => console.log(json));