Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions docs/api-reference/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {
getOperatingSystems,
getEmulationHeaders,
resolveProfile,
isNativeAvailable,

// Classes
Headers,
Expand Down Expand Up @@ -53,7 +52,6 @@ import {
| [`getOperatingSystems()`](/api-reference/utilities#getoperatingsystems) | List available operating systems |
| [`getEmulationHeaders()`](/api-reference/utilities#getemulationheaders) | Read the headers a browser profile injects |
| [`resolveProfile()`](/api-reference/utilities#resolveprofile) | Resolve a family alias to a concrete profile |
| [`isNativeAvailable()`](/api-reference/utilities#isnativeavailable) | Check whether the native addon can be loaded |

## TypeScript support

Expand Down
36 changes: 0 additions & 36 deletions docs/api-reference/utilities.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -164,42 +164,6 @@ const response = await fetch('https://example.com', {

---

## isNativeAvailable()

Report whether the native addon for the current platform can be loaded.

### Signature

```typescript
function isNativeAvailable(): boolean
```

### Returns

`true` when the addon is loadable, `false` otherwise.

The addon is loaded on first use, not when the module is imported, so `import 'wreq-js'`
never throws — a host that cannot run without it is free to check and fall back instead of
wrapping its own import in a `try`/`catch`. Calling any other export while this returns
`false` throws with the underlying reason.

It returns `false` when the platform has no published addon, when the matching
`@wreq-js/binding-*` package was skipped at install time (`--no-optional`, a strict package
manager layout, or an install performed for a different platform), or when an addon is
present but refuses to load, such as on an ABI mismatch.

### Example

```typescript
import { isNativeAvailable } from 'wreq-js';

if (!isNativeAvailable()) {
console.warn('wreq-js native addon unavailable, falling back to global fetch');
}
```

---

## Headers

The `Headers` class for working with HTTP headers.
Expand Down
96 changes: 0 additions & 96 deletions src/test/unit/native-loading.spec.ts

This file was deleted.

Loading