@lou.codes/parsers
v1.1.4
Published
ποΈβπ¨οΈ Parsers without nonsense
Downloads
1,089
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/parsersImport 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.
