shlogg · Early preview
Ramu Narasinga @karthik-m22

Exploring Defu Package In Unbuild Source Code

Discover Defu, a package by Unjs that assigns default properties recursively. Learn how to use it with examples and explore its usage in unbuild source code.

For this week, I have been reading unbuild source code and found few packages that I have never seen before or used. I wanted to share some interesting packages that are used in these OSS projects so we can learn a thing or two ;)
The following are discussed in this article:

What is Defu?
Defu’s usage in unbuild

  
  
  What is Defu?

Defu is a package built by authors at Unjs. Unjs provides JS tools, libraries and has about 63 npm packages and 421m downloads per month. Sheesh, that’s a lot.

Defu repository has this description “Assign default properties recursively”.
This package is straig...