# @gulfofmaine/tsstac

> TsSTAC is designed as a [Sans-I/O style library](https://sans-io.readthedocs.io/index.html) for loading and managing [SpatioTemporal Asset Catalogs](https://stacspec.org/).

Latest version **0.1.3** (published 2022-11-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @gulfofmaine/tsstac
pnpm add @gulfofmaine/tsstac
yarn add @gulfofmaine/tsstac
bun add @gulfofmaine/tsstac
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.3 |
| Published | 2022-11-15 |
| First published | 2022-04-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 0 |
| Unpacked size | 280.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Alex Kerney |
| Maintainers | abkfenris |

## Links

- npm: https://www.npmjs.com/package/@gulfofmaine/tsstac
- Repository: https://github.com/gulfofmaine/TsSTAC
- Homepage: https://github.com/gulfofmaine/TsSTAC#readme
- Issues: https://github.com/gulfofmaine/TsSTAC/issues
- npm.io page: https://npm.io/package/@gulfofmaine/tsstac

## Recent versions

- 0.1.3 (latest) — 2022-11-15
- 0.1.2 — 2022-09-28
- 0.1.1 — 2022-04-11
- 0.1.0 — 2022-04-08

## README

# TsSTAC

TsSTAC is designed as a [Sans-I/O style library](https://sans-io.readthedocs.io/index.html) for loading and managing [SpatioTemporal Asset Catalogs](https://stacspec.org/).

## Why Sans-I/O?

There are many different ways to fetch data in Javascript, so to make the library the most useful, we shouldn't force any specific one on users.
We can however provide a reference implementation, so that users don't have to provide their own.

By not tieing an IO method we can better accomidate different access patterns such as:
- [Single File STAC](https://github.com/stac-extensions/single-file-stac)
- Eager caching and re-hydration with [React-Query](https://github.com/stac-extensions/single-file-stac)
- Loading data from the filesystem for server side use
- Baking a catalog into an app to save preloading.

## Using TsSTAC

```ts
import STAC from "tsstac"
import fetcher from "tsstac/reference-fetch"

// Create a STAC store
// This will be in charge of loading data, and mapping from loaded URLs
// to STAC catalogs, collections, and items
const stac_store = STAC(fetch=fetcher)

// Here we're loading up the catalog for landsat from S3,
// but we are choosing to delay loading child links
// until later rather than walking the whole catalog on load
const landsat_catalog = await stac_store.get_catalog("https://landsat-stac.s3.amazonaws.com/catalog.json", walk=false)

// We can quickly view the structure of a catalog (or other STAC objects)
// by describing them
console.log(await landsat_catalog.describe(depth=2))
```

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