![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
@naturalcycles/airtable-lib
Advanced tools
High-level API and CLI for Airtable.
AirtableLib
: high-level access object
fetchBase
...AirtableDao
: access object for Airtable TableAirtableCache
: indexed contents of Airtable Base (indexed by airtableId)Entities are preferrably named without "Airtable" in their name, e.g Coupon
, not AirtableCoupon
.
Entities extend AirtableRecord
to have airtableId
required property. Idea is to not strip it
unless absolutely needed. Currently airtable-lib
doesn't do any stripping. Keeping airtableId
is
useful to be able to resolve links in runtime. AirtableCache
always keeps and index of all records
of Base by airtableId
. airtableId
is unique within your Base (not just within Table), that's why
index is built as airtableId > record
, not airtableId > Table > record
.
Any linked field in Airtable creates link in both directions (between 2 tables). Convention is to "hide" one link (typically "back-link") in Airtable UI to indicate that it's not used (if it's indeed not used and stripped from data by joi schema).
There was an idea to have a "resolve step" when downloading Airtable Base as json, to be able to
replace airtableId
s in links to whole objects. The problem there is that it creates a circular
dependency in javascript which is a very bad thing (e.g you cannot console.log
such object, or
send it over the wire). Decision was made to NOT have a resolve step but instead have a
AirtableCache
with the index of all base records (from airtableId
to Record), so it's possible
to quickly resolve links in runtime. This is a design decision.
Backing up Airtable base to json file stores all airtableId
s that are used to resolve links.
When restoring from json to Airtable Base airtableId
s cannot be preserved, that's Airtable
limitation, it needs to generate an airtableId
every time an "insert" is made. Restore still works
though, with some extra logic. It relies on existing links in json file, builds a map from
"oldAirtableId" to "newlyGeneratedAirtableId" and this way preserves the linking. Next time backup
to json is made from Airtable base - airtableId
s will be different (non-deterministic), something
to be aware of.
Backing up (as per current Airtable API) does not preserve order of rows. Restoring from json -
does preserve order (but requires to upload records sequentially one-by-one, which is slower
than concurrent uploading). To overcome this limitation it's recommended to specify "sort order" in
AirtableTableSchema
, which allows order to be deterministic. Same order needs to be applied in the
UI, to be consistent between UI and json export.
engines.node >= 10.13
: Latest Node.js LTSmain: dist/index.js
: commonjs, es2018types: dist/index.d.ts
: typescript types/src
folder with source *.ts
files includedFAQs
High-level API and CLI for Airtable
We found that @naturalcycles/airtable-lib demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.