0.1.20 • Published 5 years ago

airtable-node v0.1.20

Weekly downloads
190
License
MIT
Repository
github
Last release
5 years ago

airtable-node NPM version Build Status Dependency Status Coverage percentage

Node wrapper for Airtable API

Installation

$ npm i airtable-node --save

Usage

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

const airtable = new Airtable({ apiKey, base, table, view })

Airtable.list(params)

Airtable.list returns a promise.

Example

const airtable = new Airtable({ apiKey, base, table, view })
airtable.list({
  maxRecords: 200
}).then(resp => {
  console.log(resp)
})

Airtable.update(id, { fields })

Example

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
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

const airtable = new Airtable({apiKey, base, table})
const id = 'airtable record id'

airtable.delete(id).then(resp => {
  console.log(resp)
})

License

MIT © Ben

0.1.20

5 years ago

0.1.19

6 years ago

0.1.18

6 years ago

0.1.17

6 years ago

0.1.16

6 years ago

0.1.15

6 years ago

0.1.14

6 years ago

0.1.13

6 years ago

0.1.12

6 years ago

0.1.11

6 years ago

0.1.10

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.5

7 years ago

0.0.1

7 years ago