diff --git a/README.md b/README.md index 1d32d02..574c5d5 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,6 @@ const res = await grip( if (res.fail()) { // handle error - return; } const json = await grip( @@ -75,7 +74,6 @@ const json = await grip( if (json.of(SyntaxError)) { // handle parse error - return; } ``` @@ -88,17 +86,17 @@ The result can also be received as a tuple if you want to handle errors in Go'is const [res, fetchStatus] = await grip( fetch('https://api.example.com') ); + if (fetchStatus.fail()) { // handle error - return; } const [json, parseStatus] = await grip( res.json() ); + if (parseStatus.of(SyntaxError)) { // handle parse error - return; } ``` @@ -139,4 +137,5 @@ for await (let [value, status] of res.iter()) { ``` ## License + MIT diff --git a/dist/grip.js b/index.js similarity index 100% rename from dist/grip.js rename to index.js diff --git a/package.json b/package.json index 0e0d13f..ee1fdb8 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "typescript": "^5.0.0" }, "scripts": { - "bundle": "bun build ./grip.ts --outdir ./dist", + "bundle": "bun build ./grip.ts --outfile=index.js", "test": "bun test" } }