https://github.com/haoliangyu/ogcapi-js
A lightweight and modular JavaScript/TypeScript library for OGC APIs
https://github.com/haoliangyu/ogcapi-js
client-library features javascript ogc-apis ogcapi ogcapi-js typescript
Last synced: about 1 year ago
JSON representation
A lightweight and modular JavaScript/TypeScript library for OGC APIs
- Host: GitHub
- URL: https://github.com/haoliangyu/ogcapi-js
- Owner: haoliangyu
- License: mit
- Created: 2020-02-26T18:58:47.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-03-13T02:56:24.000Z (about 1 year ago)
- Last Synced: 2025-04-25T15:03:54.701Z (about 1 year ago)
- Topics: client-library, features, javascript, ogc-apis, ogcapi, ogcapi-js, typescript
- Language: TypeScript
- Homepage: https://haoliangyu.github.io/ogcapi-js
- Size: 9.3 MB
- Stars: 26
- Watchers: 4
- Forks: 5
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ogcapi-js
A lightweight and modular JavaScript library for [OGC APIs](https://ogcapi.ogc.org/) that implements:
* [@ogcapi-js/features](./packages/features)
* [@ogcapi-js/processes](./packages/processes)
Compared to writing the request code yourself, this library provides:
* More developer-friendly APIs
* Better request error handling
* Query parameter validation
* TypeScript support
See more details at the [documentation](https://haoliangyu.github.io/ogcapi-js).
This library is designed to work in both Node.js and browser environments.
## Testing
The stability of this library is ensured by an extensive collection of unit and E2E tests. The following sections describes how to run those tests locally.
### Unit tests
To run unit tests, execute the following command:
```bash
npm run test
```
### E2E tests
The E2E tests of this library are executed against a specially crafted OGC API instance with pre defined sample datasets based on [pygeoapi](https://pygeoapi.io/), which is provided as a Docker image.
> Note: Further information about the Docker image can be found in the corresponding [Dockerfile](./docker/e2e/Dockerfile).
To run E2E tests locally, first run the following command from the root directory of this repository to start the E2E OGC API test instance:
```bash
docker run --rm -it -p 5000:80 \
--pull=always \
--health-cmd "curl http://localhost" \
--health-interval 10s \
--health-timeout 5s \
--health-retries 5 \
ghcr.io/haoliangyu/ogcapi-js:master
```
After that, run in separate shell the following command to execute E2E tests.
```bash
$ npm run test:e2e
```
## License
MIT