@cercula-io/ec3
v0.0.4
Published
This is a programmatically-generated client for the [EC3 public API](https://openepd.buildingtransparency.org) based on the [openEPD](https://www.buildingtransparency.org/programs/openepd/) standard. It is based on [EC3's OpenAPI spec](https://openepd.bui
Downloads
12
Readme
EC3 Client for TypeScript
This is a programmatically-generated client for the EC3 public API based on the openEPD standard. It is based on EC3's OpenAPI spec, and generated using openapi-typescript-codegen.
Usage
For example:
import { EC3 } from '@cercula-io/ec3'
import type { EPD_List } from '@cercula-io/ec3'
const client = new EC3({
BASE: 'https://openepd.buildingtransparency.org/api',
TOKEN: process.env.TOKEN,
})
client.epds.getEpds().then((result) => {
console.log((result as EPD_List[]).map((e) => e.product_description))
})See the /examples directory for more.
Developing
Getting set up:
- Clone the repo
- Run
npm installto pull dependencies
Iterating:
- Update the OpenAPI spec from https://openepd.buildingtransparency.org/openapi.json and put the contents in
openapi.json, if desired - Run
npm run gento generate new code - Run
npm run buildto transpile the TypeScript code
