Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
fveracoechea committed Jul 26, 2024
1 parent 184dbd9 commit 7e10cbc
Show file tree
Hide file tree
Showing 39 changed files with 713 additions and 771 deletions.
12 changes: 0 additions & 12 deletions docs2/blog/2019-05-28-first-blog-post.md

This file was deleted.

44 changes: 0 additions & 44 deletions docs2/blog/2019-05-29-long-blog-post.md

This file was deleted.

20 changes: 0 additions & 20 deletions docs2/blog/2021-08-01-mdx-blog-post.mdx

This file was deleted.

Binary file not shown.
25 changes: 0 additions & 25 deletions docs2/blog/2021-08-26-welcome/index.md

This file was deleted.

17 changes: 0 additions & 17 deletions docs2/blog/authors.yml

This file was deleted.

16 changes: 0 additions & 16 deletions docs2/blog/tags.yml

This file was deleted.

59 changes: 36 additions & 23 deletions docs2/docs/intro.mdx → docs2/docs/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Tabs from '@theme/Tabs';

# Getting Started

Install Fetchtastic using the package manaer of your preference:
Install Fetchtastic using the package manager of your preference:

<Tabs groupId="package-manager">

Expand All @@ -19,17 +19,6 @@ Install Fetchtastic using the package manaer of your preference:

</TabItem>

<TabItem value="deno" label="deno">

```typescript
// remote import
import { Fetchtastic } from "https://deno.land/x/fetchtastic/lib/mod.ts";
// npm specifier
import { Fetchtastic } from "npm:fetchtastic";
```
</TabItem>
<TabItem value="pnpm" label="pnpm">

```sh
Expand All @@ -47,13 +36,43 @@ Install Fetchtastic using the package manaer of your preference:
</TabItem>
</Tabs>

## Import

```typescript
import { Fetchtastic } from 'fetchtastic';
```
## Compatibility
`Fetchtastic` runs everywhere fetch is available.
* Modern browsers
* Node.js >= v18
* Deno >= 0.41.0
- Modern browsers
- Deno
- Node.js >= v18
### Deno
#### Remote import
```typescript
import { Fetchtastic } from 'https://deno.land/x/fetchtastic/lib/mod.ts';
```
#### Npm specifier
```typescript
import { Fetchtastic } from 'npm:fetchtastic';
```
#### JSR
```sh
deno add @fveracoechea/fetchtastic
```
```typescript
import { Fetchtastic } from '@fveracoechea/fetchtastic';
```
### Polyfills for Node.js < v18
Expand All @@ -68,12 +87,6 @@ global.fetch = fetch;
global.FormData = FormData;
```
## Import
```typescript
import { Fetchtastic } from 'fetchtastic';
```
## Fluid interface (Chaining)
Simplifies code structure, enhances readability, and improves the overall
Expand All @@ -84,8 +97,8 @@ operations.
const request = new Fetchtastic('https://jsonplaceholder.typicode.com');
const posts = await request
.appendHeader('Content-Type', 'application/json')
.searchParams({ page: 1, first: 12 })
.get('/posts')
.searchParams({ page: 1, first: 12 })
.appendHeader('Content-Type', 'application/json')
.json();
```
9 changes: 9 additions & 0 deletions docs2/docs/reference/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"label": "API Reference",
"position": 4,
"collapsible": true,
"collapsed": false,
"link": {
"type": "generated-index"
}
}
Loading

0 comments on commit 7e10cbc

Please sign in to comment.