Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kyeotic/airtable
An alternate airtable client
https://github.com/kyeotic/airtable
Last synced: about 1 month ago
JSON representation
An alternate airtable client
- Host: GitHub
- URL: https://github.com/kyeotic/airtable
- Owner: kyeotic
- Created: 2019-05-27T01:41:59.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T05:55:09.000Z (almost 2 years ago)
- Last Synced: 2024-04-10T14:55:45.084Z (9 months ago)
- Language: JavaScript
- Size: 2.18 MB
- Stars: 7
- Watchers: 1
- Forks: 0
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @kyeotic/airtable
This is alternative to the largely undocumented, and slightly unconventional, [official client](https://github.com/Airtable/airtable.js). This library is _heavily_ inspired by the official client.
# Installation
```
npm install @kyeotic/airtable
```# Quick Start
```javascript
const { Client } = require('@kyeotic/airtable')
const client = new Client({
apiKey: string,
baseUrl: string
})
const myTable = client.base(baseId).table(tableName)let query = myTable.query({ view: 'Grid View' })
// --- Paging ---
// AsyncIterator paging
for await (let page of query()) {
console.log(page) /* {
records: [Record],
offset: string
}*/
}// Auto paging
let records = await query.all()// Stream paging
await query.eachPage(async page => {
await processPage(page.records)
})// --- CRUD ---
/* Record: {
id: string,
fields: {},
createdOn: Datetime
} */let dbItem = await myTable.get(recordId)
let newItem = await myTable.create(record)
let updated = await myTable.update({ ...newItem.fields, name: 'updated' })
await myTable.delete(recordId)
```# API
The Typedoc generated docs are hosted [here](https://kyeotic.github.io/airtable/)