@lou.codes/parsers
v1.1.3
Published
ποΈβπ¨οΈ Parsers without nonsense
Downloads
679
Maintainers
Readme
ποΈβπ¨οΈ 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 @lou.codes/parsers
as a dependency:
pnpm add @lou.codes/parsers
# or
npm install @lou.codes/parsers
# or
yarn add @lou.codes/parsers
Import it and use it:
import { parseDecimal } from "@lou.codes/parsers";
parseDecimal("101"); // 101
parseDecimal("nope"); // undefined
π¦ Deno
Import @lou.codes/parsers
using the npm:
prefix, and use it directly:
import { parseDecimal } from "npm:@lou.codes/parsers";
parseDecimal("101"); // 101
parseDecimal("nope"); // undefined
π Browser
Import @lou.codes/parsers
using esm.sh, and use it directly:
<script type="module">
import { parseDecimal } from "https://esm.sh/@lou.codes/parsers";
parseDecimal("101"); // 101
parseDecimal("nope"); // undefined
</script>
Useful links
- π Documentation: TypeDoc generated documentation.
- β³ Changelog: List of changes between versions.
- β Tests Coverage: Coveralls page with tests coverage.