Skip to content

Contributing to `es‐toolkit compat`

Sojin Park edited this page Mar 21, 2025 · 2 revisions

한국어 | 简体中文 | 日本語

Thanks for your interest in contributing to our library!

We're building a compatibility layer called es-toolkit/compat that works exactly like lodash, making migration easier. Here's how you can help:

1. Choose a function to implement

Check out this GitHub issue to find functions that still need implementation. Look through the sub-issues to find one that interests you.

find-a-function

2. Understand how the function works

Before coding, make sure you understand exactly how the function behaves by checking:

The test files in Lodash's v5-wip branch are named {functionName}.test.js and are crucial for understanding the expected behavior.

read-test

3. Implement and test your function

Add your implementation to the compat directory.

For testing, copy the test code from Lodash's v5-wip branch to ensure 100% compatibility.

Implementation checklist:

  • Does your function signature match the type in @types/lodash?
  • Have you copied the test code from Lodash to verify identical behavior?

4. Add JSDoc comments

Add clear JSDoc comments to your functions with helpful examples. You can use an AI tool with a prompt like:

Add JSDoc comments to each function declaration, including helpful examples in each one. Print the code in markdown.

{Your code here}

5. Create documentation

We need documentation files in multiple languages. If your code is in ./src/array/test.ts, create docs at:

  • English: ./docs/reference/array/test.md
  • Korean: ./docs/ko/reference/array/test.md
  • Japanese: ./docs/ja/reference/array/test.md
  • Chinese (simplified): ./docs/zh_hans/reference/array/test.md

Using our doc generator

To make this easier, we've created an automated script. First, install Deno if you don't have it:

curl -fsSL https://deno.land/install.sh | sh

Then run our doc generator:

# Run from the repository root
deno run -A ./.scripts/docs/generate-docs.mts

Translating documentation

We value translations since our library is used globally. If you have an OpenAI API key, you can automate translations:

OPENAI_API_KEY=your_key_here deno run -A ./.scripts/docs/generate-docs.mts