A plugin for running custom logic on individual data records in Flatfile.
@flatfile/plugin-record-hook
plugin offers a convenient way to execute
custom logic on individual data records within Flatfile. By setting up an event
listener for the commit:created
event, this plugin seamlessly integrates with
the data processing flow.listener.on('commit:created')
sheetSlug
parameter is the slug of the sheet you want to listen to.callback
parameter takes a function that will be run on the record or
records.chunkSize
parameter allows you to specify the quantity of records to in
each chunk.parallel
parameter allows you to specify the number of chunks to process
in parallel.@flatfile/api@1.5.13+
provides the API calls.@flatfile/hooks@1.3.1+
provides the record type.@flatfile/listener@0.3.15+
provides the listener and event types.@flatfile/util-common@0.1.1
provides utility functions for asynchronously batching.bulkRecordHook
or recordHook
to a Flatfile data listener and provide a function to run when data is added or updated.
bulkRecordHook
can accept additional properties. Props will be passed along to the transformer.
bulkRecordHook
example, it passes a chunkSize
of 100 and asks the hooks to run 2 at a time via the parallel
property.