https://github.com/pindlebot/airtable-node
Node API for Airtable without the bloat (lodash, etc)
https://github.com/pindlebot/airtable-node
airtable fetch nodejs
Last synced: about 1 year ago
JSON representation
Node API for Airtable without the bloat (lodash, etc)
- Host: GitHub
- URL: https://github.com/pindlebot/airtable-node
- Owner: pindlebot
- License: mit
- Created: 2017-07-08T18:46:51.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2020-05-23T12:23:18.000Z (about 6 years ago)
- Last Synced: 2025-03-30T17:23:25.582Z (about 1 year ago)
- Topics: airtable, fetch, nodejs
- Language: JavaScript
- Homepage: https://menubar.io
- Size: 1.3 MB
- Stars: 24
- Watchers: 1
- Forks: 6
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# airtable-node [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage percentage][coveralls-image]][coveralls-url]
> Node wrapper for Airtable API
## Installation
```sh
$ npm i airtable-node --save
```
## Usage
```js
const Airtable = require('airtable-node');
const airtable = new Airtable({ apiKey: 'xxx' })
.base('appRvT3sM3XOBruUk')
.table('Team Members')
airtable.list().then(resp => {
console.log(resp)
})
airtable.list({
filterByFormula: `NOT({Feature} = '')`, // optional
maxRecords: 200, // optional
pageSize: 100, // optional
sort: [{ field: 'name', direction: 'asc' }], // optional
view: 'Airtable View', // optional
cellFormat: 'json', // optional
timeZone, // optional
userLocale // optional
},
offset //optional
).then(resp => {
console.log(resp)
})
```
## Methods
### Airtable({ apiKey, base, table, view })
- required: apiKey
- all other parameters can be set via chaining
#### Example
```js
const airtable = new Airtable({ apiKey, base, table, view })
```
### Airtable.list(params)
Airtable.list returns a promise.
#### Example
```js
const airtable = new Airtable({ apiKey, base, table, view })
airtable.list({
maxRecords: 200
}).then(resp => {
console.log(resp)
})
```
### Airtable.update(id, { fields })
#### Example
```js
const airtable = new Airtable({ apiKey, base, table })
const id = 'airtable record id'
const fields = {
some_field_name: 'some value'
}
airtable.update(id, { fields }).then(resp => {
console.log(resp)
})
```
### Airtable.retrieve(id)
- required: id
```js
const airtable = new Airtable({ apiKey, base, table })
const id = 'airtable record id'
airtable.retrieve(id).then(resp => {
console.log(resp)
})
```
### Airtable.delete(id)
- required: id
#### Example
```js
const airtable = new Airtable({apiKey, base, table})
const id = 'airtable record id'
airtable.delete(id).then(resp => {
console.log(resp)
})
```
## License
MIT © [Ben](http://www.menubar.io)
[npm-image]: https://badge.fury.io/js/airtable-node.svg
[npm-url]: https://npmjs.org/package/airtable-node
[travis-image]: https://travis-ci.org/focuswish/airtable-node.svg?branch=master
[travis-url]: https://travis-ci.org/focuswish/airtable-node
[daviddm-image]: https://david-dm.org/focuswish/airtable-node.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/focuswish/airtable-node
[coveralls-image]: https://coveralls.io/repos/focuswish/airtable-node/badge.svg
[coveralls-url]: https://coveralls.io/r/focuswish/airtable-node