Thienn2 | Note

Bundle React with Deno

#deno #react
        
          $ deno --version
          deno 1.9.0 (release, x86_64-pc-windows-msvc)
          v8 9.1.269.5
          typescript 4.2.2

          $ deno bundle --unstable --watch ./src/index.tsx docs/bundle.js
        
      

Example node-fetch

#node #fetch #node-fetch
        
          $ npm install node-fetch
          $ cat index.js
          #!/usr/bin/node
          const fetch = require("node-fetch")

          fetch('https://my-json-server.typicode.com/typicode/demo/posts', {
            mode: 'cors',
            headers: {
              'Content-Type': 'application/xml',
              'Accept': '*/*'
            }
          })
            .then(resp => resp.text())
            .then(console.log)
            .catch(console.error)
          $ node index.js
          # See result below :))