Skip to content
This repository has been archived by the owner on Feb 2, 2024. It is now read-only.
/ parsers Public archive

πŸ‘οΈβ€πŸ—¨οΈ Parsers without nonsense

License

Notifications You must be signed in to change notification settings

vangware/parsers

Repository files navigation

This repository's code was moved to lou.codes.


Coverage License NPM Version Open Issues

πŸ‘οΈβ€πŸ—¨οΈ Parsers without nonsense.

Instead of throwing or returning values like NaN, the parsers in this library either return the expected parsed value or undefined (making use of the Maybe type).

Usage

πŸ“¦ Node

Install @vangware/parsers as a dependency:

pnpm add @vangware/parsers
# or
npm install @vangware/parsers
# or
yarn add @vangware/parsers

Import it and use it:

import { parseDecimal } from "@vangware/parsers";

parseDecimal("101"); // 101
parseDecimal("nope"); // undefined

πŸ¦• Deno

Import @vangware/parsers using the npm: prefix, and use it directly:

import { parseDecimal } from "npm:@vangware/parsers";

parseDecimal("101"); // 101
parseDecimal("nope"); // undefined

🌎 Browser

Import @vangware/parsers using esm.sh, and use it directly:

<script type="module">
	import { parseDecimal } from "https://esm.sh/@vangware/parsers";

	parseDecimal("101"); // 101
	parseDecimal("nope"); // undefined
</script>

Useful links