npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@superbasicxyz/airtabler

v0.4.1

Published

Open source Airtable API client

Readme

Airtabler

npm version npm bundle size

Airtable API client written in Typescript. Airtabler's aim is to simplify the implementation of common patterns when using Airtable as a backend for an application.

Read the docs.

Consider versus airtable.js.

Getting started

Installation

npm install @superbasicxyz/airtabler

# OR

yarn add @superbasicxyz/airtabler

Initialize

import { airtabler } from "@superbasicxyz/airtabler";

const config = {
  apiKey: "[YOUR-AIRTABLE-API-KEY]",
  baseId: "[YOUR-AIRTABLE-BASE-ID]"
};

const db = airtabler.init(config);

Instantiate a Model object

.model(tableName)

Instantiate a connection to a particular table in your Airtable base.

Parameters: tableName: string Required

Returns Model object

const events = db.model("Events");

Query data using the Model object

.all()

Retrieve all Event records from your Airtable base.

Parameters: none

Returns AirtableRecord[]

const allEvents = await events.all();

/*
[
  {
    id: "recXXXXXXXXXXXXX",
    createdTime: "2022-07-19T22:41:33.000Z",
    fields: { name: "Birthday Party", id: "recXXXXXXXXXXXXXX" }
  },
  {
    id: "recXXXXXXXXXXXXX",
    createdTime: "2022-07-19T22:41:33.000Z",
    fields: { name: "Graduation Party", id: "recXXXXXXXXXXXXXXX" }
  },
  {
    id: "recXXXXXXXXXXXXX",
    createdTime: "2022-07-19T22:41:33.000Z",
    fields: { name: "Wedding Reception", id: "recXXXXXXXXXXXXXX" }
  }
]
*/

.find(recordId)

Retrieve a single Event from your Airtable base.

Parameters: recordId: string Required

Returns AirtableRecord

const event = await events.find("recXXXXXXXXXXXXXX");

/*
{
  id: "recXXXXXXXXXXXXX",
  createdTime: "2022-07-19T22:41:38.000Z",
  fields: { name: "Birthday Party", id: "recXXXXXXXXXXXX" }
}
*/

.where(params) (in progress)

Retrieve a collection of Events that match criteria defined in params.

The keys of the parameter object are the names of the column in your Airtable base.

Parameters: params: Record<string, string | string[]> Required

Returns AirtableRecord[]

const graduationParties = await events.where({ name: "Graduation Party" });

/*
[
  {
    id: "recgJYM1juGmJfX3g",
    createdTime: "2022-04-29T20:05:09.000Z",
    fields: { Name: "Graduation Party", id: "recgJYM1juGmJfX3g" }
  },
  {
    id: "reczoSVcf1htzZymV",
    createdTime: "2022-04-29T20:05:09.000Z",
    fields: { Name: "Graduation Party", id: "reczoSVcf1htzZymV" }
  }
]
*/

You can pass an array of ids to the where function to select multiple records by their id. This is especially helpful when working with relationships between tables, as the Airtable API returns these columns as an...array of ids.

const event = await events.find("recXXXXXXXXXX"); // { ...Dogs: ["recXXXXXXXX", "recYYYYYYYY"] ... }
const dogs = db.model("Dogs");
const partyDogs = await dogs.where({ id: event.fields.Dogs });

/*
[
  {
    id: "recXXXXXXXXXX",
    createdTime: "2022-04-29T20:05:09.000Z",
    fields: { Name: "Doggo" }
  },
  {
    id: "recYYYYYYYYYY",
    createdTime: "2022-04-29T20:05:09.000Z",
    fields: { Name: "Grapes" }
  }
  {
]
*/

.create({ fields }) or .create([ fields ])

Create single record by passing an object with keys that match the column names in your base or up to 10 records by passing an array of the same objects

Parameters: params: AirtableRecordFields | AirtableRecordFields[]

Returns AirtableRecord[]

const newEvent = await events.create({ Name: "Ultimate Cake Party" });

/*
{
  records: [
    {
      id: 'recYYYYYYYYYYY',
      createdTime: '2022-07-19T22:39:55.000Z',
      fields: {
        Name: 'Ultimate Cake Party',
        ...
      }
    }
  ]
}
*/
const newEvents = await events.create([
  { Name: "Dogville Thanksgiving" },
  { Name: "Catland Cloud Retreat" }
]);

/*
{
  records: [
    {
      id: 'recXXXXXXXXXX',
      createdTime: '2022-07-19T22:39:55.000Z',
      fields: {
        Name: 'Dogville Thanksgiving',
        ...
      }
    },
    {
      id: 'recYYYYYYYYYYY',
      createdTime: '2022-07-19T22:39:55.000Z',
      fields: {
        Name: 'Catland Cloud Retreat',
        ...
      }
    }
  ]
}
*/

.update({ id, fields }) or .create([ id, fields ])

Update single record by passing an object with id and keys that match the column names in your base or up to 10 records by passing an array of the same objects.

Parameters: params: AirtableRecord | AirtableRecord[]

Returns AirtableRecord[]

const updatedEvent = await events.update({
  id: "recYYYYYYYY",
  fields: { Name: "Ultimate Cake Party" }
});

/*
{
  records: [
    {
      id: 'recYYYYYYYYYYY',
      createdTime: '2022-07-19T22:39:55.000Z',
      fields: {
        Name: 'Ultimate Cake Party',
        ...
      }
    }
  ]
}
*/
const updatedEvents = await events.update([
  { id: "recXXXXXXXXXX", fields: { Name: "Dogville Thanksgiving" } },
  { id: "recYYYYYYYYYY", fields: { Name: "Catland Cloud Retreat" } }
]);

/*
{
  records: [
    {
      id: 'recXXXXXXXXXX',
      createdTime: '2022-07-19T22:39:55.000Z',
      fields: {
        Name: 'Dogville Thanksgiving',
        ...
      }
    },
    {
      id: 'recYYYYYYYYYYY',
      createdTime: '2022-07-19T22:39:55.000Z',
      fields: {
        Name: 'Catland Cloud Retreat',
        ...
      }
    }
  ]
}
*/

.destroy(recordId) or .destroy([recordIds])

Delete single record by its id or up to 10 records by passing an array of ids. The 10 records limit is a restriction of the Airtable API.

Parameters: recordIds: string | string[] Required

Returns AirtableRecord[] (kind of)

events.destroy("recYYYYYYYYY");

# OR

events.destroy(["recYYYYYYYYYYYY", "recZZZZZZZZZZZ"]);


/*
[
  { id: "recYYYYYYYYYY", deleted: true },
  { id: "recZZZZZZZZZZ", deleted: true }
]
*/

.tableName()

Parameters: none

Returns string

const tableName = events.tableName();

// "Events"

.tableUrl()

Parameters: none

Returns string

const tableUrl = events.tableUrl();

// "https://api.airtable.com/v0/appXXXXXXXXXX/Events"

Contributing

Refer to our contribution guidelines and Code of Conduct for contributors.