A new edition of 1loc.dev

Small code.
Working integrations.

Useful JavaScript. Practical email recipes.Run the code. Read the edge case.Take a working example back to your project.

323 utilities5 recipes4 labsNo signup. Lab data stays in your browser.

02 / array

Less repetition. Same order.

Deduplicate a recipient list before you send it. The first occurrence wins.

Code JavaScript
function unique(values) { return [...new Set(values)]; }
Output Expected result
["ana@example.com", "rui@example.com", "lia@example.com"]

Expected output shown. Run it to execute the function in your browser.

What are you building?

Start with the problem in front of you.

01 — The library

Find your next small solution.

Small enough to read in one breath — with the edge case and the limits written down.

Browse all 323

Clone an array

Create a new array without copying the objects inside it.

function clone(values) { return [...values]; }array

Remove duplicate values

Keep the first occurrence of each value, in its original order.

function unique(values) { return [...new Set(values)]; }array

Flatten a nested array

Turn a nested array into one sequence of values.

function flatten(values) { return values.flat(Infinity); }array

Split an array into chunks

Build consecutive chunks without changing the original array.

function chunk({ values, size }) { return Array.from({ length: Math.ceil(values.length / size) …array

Find the intersection of arrays

Return the distinct values that occur in both arrays.

function intersection({ left, right }) { const other = new Set(right); return [...new Set(left)…array

Sort numbers in ascending order

Sort a numeric copy instead of using JavaScript’s default string ordering.

function sortNumbers(values) { return [...values].sort((a, b) => a - b); }array

Prefer it all on one page? Print the one-line sheet — every utility as the code that runs.

02 — Recipes

From one line to a working integration.

Complete Node.js/TypeScript starters with tests, failure handling and a local mock. No account is needed to run them.

All recipes

03 — Labs

See what the code does.

Change the data, follow the states and break a signature on purpose. Everything runs in your browser.

All labs

04 — Maintained by Oveyon

When the next line is an email.

1loc.dev is maintained by Oveyon: transactional email infrastructure with an API and SMTP for your software, inboxes your agents can read safely, and a record of every send. The recipes here are written against its API.

recipes/transactional-email · request.sh
curl https://api.oveyon.com/v1/send \
  -H "Authorization: Bearer $OVEYON_API_KEY" \
  -H 'Content-Type: application/json' \
  -H 'X-Oveyon-Sandbox: 1' \
  -H 'Idempotency-Key: 1loc:welcome:demo-001' \
  --data '{"from":"sender@your-verified-domain.example","to":"reader@example.net","subject":"Demo","text":"Synthetic sandbox example"}'
202 accepted sandbox: frozen, never deliveredThe recipe’s optional sandbox request. Accepted is not delivered — and this page never sends anything.

Free plan: 1,000 emails a month, no card required — as published on oveyon.com, checked October 28, 2026. Oveyon maintains this site; the relationship is commercial and disclosed.

05 — How we verify

Code with a paper trail.

Each utility links to its original source. Each recipe names its runtime, expected result and limits. A local mock is labeled as a local mock.

The method
  1. Local fixtures Executed

    Transformations, request construction, signatures, persistence and state transitions run against synthetic data.

  2. Contract review Reviewed

    Examples checked against a captured Oveyon OpenAPI 3.1 document and the official reference.

  3. Authenticated sandbox Not executed

    Requires a test account and a manual job. No badge is shown until it runs.

  4. Controlled real delivery Not executed

    Even then, recipient-server acceptance would not prove inbox placement.

Changelog · October 28, 2026

The whole original collection is back.

Every page of the original 1loc collection by Nguyen Huu Phuoc and contributors lives again at its address: 235 run in the local lab, 78 more as references whose usage runs in Node.js and Chromium. Bugs found in review are fixed and explained on each page.

Read the changelog

Type two or more characters. Try “duplicate”, “webhook” or “retry”.