TempoLife

TempoLifeOpen-source and the food API › unit-convert

unit-convert (JS)

The tiny, dependency-free converter behind units.tempolife.app, as an open package.

Plannedstatus
read-onlyaccess
free (fair use)cost

This is planned and not published yet. The interface below shows what we intend to ship and may change.

What it is

The weight, length, energy and volume conversions used across the TempoLife reference sites are small and self-contained. We plan to release them as a dependency-free JavaScript package so anyone can reuse the exact same factors — including the decilitre and cup handling that many converters get wrong. It is planned; the interface below shows the intended API and may change before a first release.

Examples

Planned usage

import { convert } from '@tempolife/unit-convert';

convert(70, 'kg', 'lb');   // 154.3236
convert(1, 'dl', 'ml');    // 100

Other packages

Food & nutrition API

A read-only HTTP API for searching foods and reading their nutrition per 100 g.

Beta

Open nutrition dataset

A downloadable CSV/JSON snapshot of common foods and their per-100 g nutrition.

Planned

Source: TempoLife open-source and API docs. Status is current as of the check date; a beta or planned status means the interface can still change. · checked 2026-09-04

Frequently asked questions

Is unit-convert (JS) ready to use?

Not yet — it is planned. The shape shown here is the intended interface and may change before the first release.

What does it cost?

Nothing within fair use. The released code is open source under a permissive licence with attribution; the beta API is free within a rate limit.

Or just use the app

TempoLife gives you the whole food database plus calculators and trackers, free, no code required.

Get the app freeGet the app