<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>javascript on ankit bahuguna</title>
    <link>https://ankitbahuguna.xyz/tags/javascript/</link>
    <description>Recent content in javascript on ankit bahuguna</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Mon, 16 Oct 2023 18:48:12 +0530</lastBuildDate>
    <atom:link href="https://ankitbahuguna.xyz/tags/javascript/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Lazy Evaluation</title>
      <link>https://ankitbahuguna.xyz/posts/lazy-evaluation/</link>
      <pubDate>Mon, 16 Oct 2023 18:48:12 +0530</pubDate>
      <guid>https://ankitbahuguna.xyz/posts/lazy-evaluation/</guid>
      <description>Learning OCaml and Lazy Evaluation Lazy evaluation is a cool concept that delays computations until they&amp;rsquo;re actually needed, saving resources and time. OCaml is great for this, but TypeScript and Go can do it too in their own ways.
OCaml Example OCaml uses lazy streams to generate Fibonacci numbers:
type &amp;#39;a stream = Cons of &amp;#39;a * &amp;#39;a stream Lazy.t let rec fibs a b = Cons (a, lazy (fibs b (a + b))) let rec take n (Cons (x, xs)) = if n &amp;lt;= 0 then [] else x :: take (n - 1) (Lazy.</description>
    </item>
    <item>
      <title>Node VM</title>
      <link>https://ankitbahuguna.xyz/posts/trying-out-node-vm-module/</link>
      <pubDate>Mon, 02 Oct 2023 17:56:37 +0530</pubDate>
      <guid>https://ankitbahuguna.xyz/posts/trying-out-node-vm-module/</guid>
      <description>I recently used Node&amp;rsquo;s VM module with a CLI tool to allow passing custom JavaScript via command line flags. The tool interacts with a REST API that returns JSON responses.
So for instance, we have a users end point that returns users. It accepts some filters but sometimes you may want to filter or transform the output in some way.
myclitool get users limit 10 [ { name: &amp;#39;jon&amp;#39;, email: &amp;#39;jon@doe.</description>
    </item>
    <item>
      <title>Async Generators</title>
      <link>https://ankitbahuguna.xyz/posts/using-async-generators-in-node-js/</link>
      <pubDate>Tue, 20 Jul 2021 20:12:06 +0530</pubDate>
      <guid>https://ankitbahuguna.xyz/posts/using-async-generators-in-node-js/</guid>
      <description>So I recently put Javascript generator functions to a good use.
I needed to retrieve all the users from Cognito and then filter them out based on the value of a custom attribute. The Cognito only returns a maximum of 60 users in a single call and a PaginationToken if there are more users. The PaginationToken can then be used to retrieve more users.
So this is the solution I came up with.</description>
    </item>
    <item>
      <title>Scraping Leetcode With Puppeteer</title>
      <link>https://ankitbahuguna.xyz/posts/scraping-leetcode/</link>
      <pubDate>Fri, 16 Apr 2021 18:48:12 +0530</pubDate>
      <guid>https://ankitbahuguna.xyz/posts/scraping-leetcode/</guid>
      <description>Warning: This code no longer works since there has been a change in Leetcode&amp;rsquo;s website from the time this post was written.
I am, by no means, a Fangsexual and I don&amp;rsquo;t enjoy solving problems on the LeetCode, so I decided to find a way to quickly download the top 15 most voted solutions for any problem.
I&amp;rsquo;ve been playing around with Puppeteer and it seemed like a good idea to use it for something like this.</description>
    </item>
  </channel>
</rss>
