# cosmos-directory-client

> JavaScript client for fetching cosmos.directory endpoints 🛵

Latest version **0.0.6** (published 2022-08-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install cosmos-directory-client
pnpm add cosmos-directory-client
yarn add cosmos-directory-client
bun add cosmos-directory-client
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2022-08-30 |
| First published | 2022-08-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 9.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Griko Nibras |
| Maintainers | codingki, xanderjl, strangelove_griko, grikomsn |

## Links

- npm: https://www.npmjs.com/package/cosmos-directory-client
- Repository: https://github.com/strangelove-ventures/cosmos-directory-client
- Issues: https://github.com/strangelove-ventures/cosmos-directory-client/issues
- npm.io page: https://npm.io/package/cosmos-directory-client

## Dependencies (2)

- [node-fetch-native](https://npm.io/package/node-fetch-native.md) latest
- [cosmos-directory-types](https://npm.io/package/cosmos-directory-types.md) 0.0.6

## Recent versions

- 0.0.6 (latest) — 2022-08-30
- 0.0.5 — 2022-08-30
- 0.0.4 — 2022-08-26
- 0.0.3 — 2022-08-25

## README

[![npm/v](https://badgen.net/npm/v/cosmos-directory-client)](https://www.npmjs.com/package/cosmos-directory-client)
[![npm/dt](https://badgen.net/npm/dt/cosmos-directory-client)](https://www.npmjs.com/package/cosmos-directory-client)
[![stars](https://badgen.net/github/stars/strangelove-ventures/cosmos-directory-client)](https://github.com/strangelove-ventures/cosmos-directory-client)

# cosmos-directory-client

JavaScript client for fetching cosmos.directory endpoints 🛵

## Installing

```sh
# using npm
npm install cosmos-directory-client

# using yarn
yarn add cosmos-directory-client

# using pnpm
pnpm add cosmos-directory-client
```

## Basic example

**Creating client**

You can create the directory client via class or using helper functions:

```ts
import { DirectoryClient, createClient, createTestnetClient } from "cosmos-directory-client";

const client = new DirectoryClient({ ... });
const clientAlt = createClient({ ... });
const testnetClient = createTestnetClient({ ... });
```

All clients defaults to https://cosmos.directory and https://testcosmos.directory for testnet client. You can pass optional arguments on instantiation.

**Using client**

All fetcher functions uses the built-in `fetch` object. You can pass custom `fetch` implementation when instantiating the client.

```ts
const { chains } = await client.fetchChains();
const { chain } = await client.fetchChain("juno");
const { chains } = await client.fetchStatus();
const { validators } = await client.fetchValidators();
const { validator } = await client.fetchValidator("frens");
```

## API

View library APIs via paka.dev: https://paka.dev/npm/cosmos-directory-client

## License

[MIT License, Copyright (c) 2022 Strangelove Ventures](./LICENSE)

---
_Source: https://npm.io/package/cosmos-directory-client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
