https://github.com/zachary822/json-parser
JSON parser
https://github.com/zachary822/json-parser
deno json parser-combinators
Last synced: about 2 months ago
JSON representation
JSON parser
- Host: GitHub
- URL: https://github.com/zachary822/json-parser
- Owner: zachary822
- Created: 2024-12-17T04:38:22.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-17T08:39:47.000Z (over 1 year ago)
- Last Synced: 2025-01-10T07:50:03.069Z (over 1 year ago)
- Topics: deno, json, parser-combinators
- Language: TypeScript
- Homepage: https://jsr.io/@fun/json-parser
- Size: 18.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# JSON Parser
```typescript
import { jsonValue, snd, strToList } from "@fun/json-parser";
const input = strToList('"abc"');
const maybeParse = jsonValue(input);
// retrieving the value from Maybe
const result = maybeParse(
// default return value if parser doesn't match input
null,
// the javascript object from the JSON string
(x) => snd(x),
);
```