convert

SI Units

inchesToMeters

Converts inches to meters.

import { inchesToMeters } from '@jonibach/convert'

const result = inchesToMeters(1)

params:

  1. inches

async: no

Demo not found

metersToInches

Converts meters to inches.

import { metersToInches } from '@jonibach/convert'

const result = metersToInches(1)

params:

  1. meters

async: no

Demo not found

feetToMeters

Converts feet to meters.

import { feetToMeters } from '@jonibach/convert'

const result = feetToMeters(1)

params:

  1. feet

async: no

Demo not found

metersToFeet

Converts meters to feet.

import { metersToFeet } from '@jonibach/convert'

const result = metersToFeet(1)

params:

  1. meters

async: no

Demo not found

milesToMeters

Converts miles to meters.

import { milesToMeters } from '@jonibach/convert'

const result = milesToMeters(1)

params:

  1. miles

async: no

Demo not found

metersToMiles

Converts meters to miles.

import { metersToMiles } from '@jonibach/convert'

const result = metersToMiles(1)

params:

  1. meters

async: no

Demo not found

poundsToKilograms

Converts pounds to kilograms.

import { poundsToKilograms } from '@jonibach/convert'

const result = poundsToKilograms(1)

params:

  1. pounds

async: no

Demo not found

kilogramsToPounds

Converts kilograms to pounds.

import { kilogramsToPounds } from '@jonibach/convert'

const result = kilogramsToPounds(1)

params:

  1. kilograms

async: no

Demo not found

ouncesToKilograms

Converts ounces to kilograms.

import { ouncesToKilograms } from '@jonibach/convert'

const result = ouncesToKilograms(1)

params:

  1. ounces

async: no

Demo not found

kilogramsToOunces

Converts kilograms to ounces.

import { kilogramsToOunces } from '@jonibach/convert'

const result = kilogramsToOunces(1)

params:

  1. kilograms

async: no

Demo not found

gallonsToLiters

Converts US gallons to liters.

import { gallonsToLiters } from '@jonibach/convert'

const result = gallonsToLiters(1)

params:

  1. gallons

async: no

Demo not found

litersToGallons

Converts liters to US gallons.

import { litersToGallons } from '@jonibach/convert'

const result = litersToGallons(1)

params:

  1. liters

async: no

Demo not found

cubicFeetToLiters

Converts cubic feet to liters.

import { cubicFeetToLiters } from '@jonibach/convert'

const result = cubicFeetToLiters(1)

params:

  1. cubicFeet

async: no

Demo not found

litersToCubicFeet

Converts liters to cubic feet.

import { litersToCubicFeet } from '@jonibach/convert'

const result = litersToCubicFeet(1)

params:

  1. liters

async: no

Demo not found

fahrenheitToKelvin

Converts Fahrenheit to Kelvin.

import { fahrenheitToKelvin } from '@jonibach/convert'

const result = fahrenheitToKelvin(32)

params:

  1. fahrenheit

async: no

Demo not found

kelvinToFahrenheit

Converts Kelvin to Fahrenheit.

import { kelvinToFahrenheit } from '@jonibach/convert'

const result = kelvinToFahrenheit(273.15)

params:

  1. kelvin

async: no

Demo not found

celsiusToKelvin

Converts Celsius to Kelvin.

import { celsiusToKelvin } from '@jonibach/convert'

const result = celsiusToKelvin(0)

params:

  1. celsius

async: no

Demo not found

kelvinToCelsius

Converts Kelvin to Celsius.

import { kelvinToCelsius } from '@jonibach/convert'

const result = kelvinToCelsius(273.15)

params:

  1. kelvin

async: no

Demo not found

caloriesToJoules

Converts calories to joules.

import { caloriesToJoules } from '@jonibach/convert'

const result = caloriesToJoules(1)

params:

  1. calories

async: no

Demo not found

joulesToCalories

Converts joules to calories.

import { joulesToCalories } from '@jonibach/convert'

const result = joulesToCalories(1)

params:

  1. joules

async: no

Demo not found

btusToJoules

Converts BTUs to joules.

import { btusToJoules } from '@jonibach/convert'

const result = btusToJoules(1)

params:

  1. btus

async: no

Demo not found

joulesToBtus

Converts joules to BTUs.

import { joulesToBtus } from '@jonibach/convert'

const result = joulesToBtus(1)

params:

  1. joules

async: no

Demo not found

psiToPascals

Converts PSI to Pascals.

import { psiToPascals } from '@jonibach/convert'

const result = psiToPascals(1)

params:

  1. psi

async: no

Demo not found

pascalsToPsi

Converts Pascals to PSI.

import { pascalsToPsi } from '@jonibach/convert'

const result = pascalsToPsi(1)

params:

  1. pascals

async: no

Demo not found

atmospheresToPascals

Converts atmospheres to Pascals.

import { atmospheresToPascals } from '@jonibach/convert'

const result = atmospheresToPascals(1)

params:

  1. atmospheres

async: no

Demo not found

pascalsToAtmospheres

Converts Pascals to atmospheres.

import { pascalsToAtmospheres } from '@jonibach/convert'

const result = pascalsToAtmospheres(1)

params:

  1. pascals

async: no

Demo not found

horsepowerToWatts

Converts horsepower to watts.

import { horsepowerToWatts } from '@jonibach/convert'

const result = horsepowerToWatts(1)

params:

  1. horsepower

async: no

Demo not found

wattsToHorsepower

Converts watts to horsepower.

import { wattsToHorsepower } from '@jonibach/convert'

const result = wattsToHorsepower(1)

params:

  1. watts

async: no

Demo not found

Strings

urlToEncode

Converts a URL string to an encoded URL string.

import { urlToEncode } from '@jonibach/convert'

const result = urlToEncode(https://example.com/?search=query)

params:

  1. str

async: no

Demo not found

urlToDecode

Converts an encoded URL string to a URL string.

import { urlToDecode } from '@jonibach/convert'

const result = urlToDecode(https%3A%2F%2Fexample.com%2F%3Fsearch%3Dquery)

params:

  1. str

async: no

Demo not found

stringToHex

Converts a string to a hexadecimal string.

import { stringToHex } from '@jonibach/convert'

const result = stringToHex(example)

params:

  1. str

async: no

Demo not found

hexToString

Converts a hexadecimal string to a string.

import { hexToString } from '@jonibach/convert'

const result = hexToString(6578616d706c65)

params:

  1. hex

async: no

Demo not found

stringToBinary

Converts a string to a binary string.

import { stringToBinary } from '@jonibach/convert'

const result = stringToBinary(example)

params:

  1. str

async: no

Demo not found

binaryToString

Converts a binary string to a string.

import { binaryToString } from '@jonibach/convert'

const result = binaryToString(01100101 01111000 01100001 01101101 01110000 01101100 01100101)

params:

  1. binary

async: no

Demo not found

webStringToBase64

Converts a string to a base64 string using the Web API.

import { webStringToBase64 } from '@jonibach/convert'

const result = webStringToBase64(example string)

params:

  1. str

async: no

Demo not found

webBase64ToString

Converts a base64 string to a string using the Web API.

import { webBase64ToString } from '@jonibach/convert'

const result = webBase64ToString(ZXhhbXBsZSBzdHJpbmc=)

params:

  1. b64

async: no

Demo not found

Numeric

binaryToDecimal

Converts a binary string to a decimal number.

import { binaryToDecimal } from '@jonibach/convert'

const result = binaryToDecimal(1010)

params:

  1. binaryString

async: no

Demo not found

decimalToBinary

Converts a decimal number to a binary string.

import { decimalToBinary } from '@jonibach/convert'

const result = decimalToBinary(10)

params:

  1. decimalNumber

async: no

Demo not found

hexadecimalToDecimal

Converts a hexadecimal string to a decimal number.

import { hexadecimalToDecimal } from '@jonibach/convert'

const result = hexadecimalToDecimal(A)

params:

  1. hexString

async: no

Demo not found

decimalToHexadecimal

Converts a decimal number to a hexadecimal string.

import { decimalToHexadecimal } from '@jonibach/convert'

const result = decimalToHexadecimal(10)

params:

  1. decimalNumber

async: no

Demo not found

binaryToHexadecimal

Converts a binary string to a hexadecimal string.

import { binaryToHexadecimal } from '@jonibach/convert'

const result = binaryToHexadecimal(1010)

params:

  1. binaryString

async: no

Demo not found

hexadecimalToBinary

Converts a hexadecimal string to a binary string.

import { hexadecimalToBinary } from '@jonibach/convert'

const result = hexadecimalToBinary(A)

params:

  1. hexString

async: no

Demo not found

decimalToOctal

Converts a decimal number to an octal string.

import { decimalToOctal } from '@jonibach/convert'

const result = decimalToOctal(10)

params:

  1. decimalNumber

async: no

Demo not found

octalToDecimal

Converts an octal string to a decimal number.

import { octalToDecimal } from '@jonibach/convert'

const result = octalToDecimal(12)

params:

  1. octalString

async: no

Demo not found

Date

dateToTimestamp

Converts a date object to a Unix timestamp.

import { dateToTimestamp } from '@jonibach/convert'

const result = dateToTimestamp(Sun Dec 22 2024 17:22:18 GMT+0000 (Coordinated Universal Time))

params:

  1. date

async: no

Demo not found

timestampToDate

Converts a Unix timestamp to a date object.

import { timestampToDate } from '@jonibach/convert'

const result = timestampToDate(1734888138300)

params:

  1. timestamp

async: no

Demo not found

dateToISOString

Converts a date object to an ISO 8601 string.

import { dateToISOString } from '@jonibach/convert'

const result = dateToISOString(Sun Dec 22 2024 17:22:18 GMT+0000 (Coordinated Universal Time))

params:

  1. date

async: no

Demo not found

isoStringToDate

Converts an ISO 8601 string to a date object.

import { isoStringToDate } from '@jonibach/convert'

const result = isoStringToDate(2024-12-22T17:22:18.300Z)

params:

  1. isoString

async: no

Demo not found

timestampToISOString

Converts a Unix timestamp to an ISO 8601 string.

import { timestampToISOString } from '@jonibach/convert'

const result = timestampToISOString(1734888138302)

params:

  1. timestamp

async: no

Demo not found

isoStringToTimestamp

Converts an ISO 8601 string to a Unix timestamp.

import { isoStringToTimestamp } from '@jonibach/convert'

const result = isoStringToTimestamp(2024-12-22T17:22:18.302Z)

params:

  1. isoString

async: no

Demo not found

dateToLocalString

Converts a date object to a localized date and time string.

import { dateToLocalString } from '@jonibach/convert'

const result = dateToLocalString(Sun Dec 22 2024 17:22:18 GMT+0000 (Coordinated Universal Time),en-US,[object Object])

params:

  1. date

  2. locale = 'default'

  3. options

async: no

Demo not found

dateToDayOfWeek

Converts a date object to the day of the week.

import { dateToDayOfWeek } from '@jonibach/convert'

const result = dateToDayOfWeek(Sun Dec 22 2024 17:22:18 GMT+0000 (Coordinated Universal Time),en-US)

params:

  1. date

  2. locale = 'en-US'

async: no

Demo not found

Color

rgbToHsl

Converts an RGB color to an HSL color.

import { rgbToHsl } from '@jonibach/convert'

const result = rgbToHsl([object Object])

params:

  1. { r

  2. g

  3. b }

async: no

Demo not found

hslToRgb

Converts an HSL color to an RGB color.

import { hslToRgb } from '@jonibach/convert'

const result = hslToRgb([object Object])

params:

  1. { h

  2. s

  3. l }

async: no

Demo not found

hexToHsl

Converts a hex color to an HSL color.

import { hexToHsl } from '@jonibach/convert'

const result = hexToHsl(#ffffff)

params:

  1. hex

async: no

Demo not found

hslToHex

Converts an HSL color to a hex color.

import { hslToHex } from '@jonibach/convert'

const result = hslToHex([object Object])

params:

  1. { h

  2. s

  3. l }

async: no

Demo not found

rgbaToString

Converts an RGBA color to a CSS string.

import { rgbaToString } from '@jonibach/convert'

const result = rgbaToString([object Object])

params:

  1. { r

  2. g

  3. b

  4. a = 1 }

async: no

Demo not found

hslaToString

Converts an HSLA color to a CSS string.

import { hslaToString } from '@jonibach/convert'

const result = hslaToString([object Object])

params:

  1. { h

  2. s

  3. l

  4. a = 1 }

async: no

Demo not found

complementaryHsl

Calculates the complementary HSL color.

import { complementaryHsl } from '@jonibach/convert'

const result = complementaryHsl([object Object])

params:

  1. { h

  2. s

  3. l }

async: no

Demo not found

Format

jsonStringToObject

Converts a JSON string to an object.

import { jsonStringToObject } from '@jonibach/convert'

const result = jsonStringToObject({"name":"John","age":30})

params:

  1. jsonString

async: no

Demo not found

objectToJsonString

Converts an object to a JSON string.

import { objectToJsonString } from '@jonibach/convert'

const result = objectToJsonString([object Object])

params:

  1. object

async: no

Demo not found

yamlToJson

Converts a YAML string to a JSON object.

import { yamlToJson } from '@jonibach/convert'

const result = yamlToJson(name: John age: 30)

params:

  1. yamlString

async: no

Demo not found

jsonToYaml

Converts a JSON object to a YAML string.

import { jsonToYaml } from '@jonibach/convert'

const result = jsonToYaml([object Object])

params:

  1. jsonObject

async: no

Demo not found

csvToJson

Converts a CSV string to a JSON object.

import { csvToJson } from '@jonibach/convert'

const result = csvToJson(name,age John,30)

params:

  1. csvString

async: no

Demo not found

jsonToCsv

Converts a JSON object to a CSV string.

import { jsonToCsv } from '@jonibach/convert'

const result = jsonToCsv([object Object])

params:

  1. jsonObject

async: no

Demo not found

xmlToJson

Converts an XML string to a JSON object.

import { xmlToJson } from '@jonibach/convert'

const result = xmlToJson(<person><name>John</name><age>30</age></person>)

params:

  1. xmlString

async: yes

Demo not found

jsonToXml

Converts a JSON object to an XML string.

import { jsonToXml } from '@jonibach/convert'

const result = jsonToXml([object Object])

params:

  1. jsonObject

async: no

Demo not found

markdownToHtml

Converts a markdown string to an HTML string.

import { markdownToHtml } from '@jonibach/convert'

const result = markdownToHtml(# Hello World)

params:

  1. markdownText

async: yes

Demo not found

compressString

Compresses a string using the DEFLATE algorithm.

import { compressString } from '@jonibach/convert'

const result = compressString(Hello World)

params:

  1. str

async: no

Demo not found

decompressToString

Decompresses a Uint8Array to a string using the DEFLATE algorithm.

import { decompressToString } from '@jonibach/convert'

const result = decompressToString()

params:

  1. data

async: no

Demo not found