# js Run `function()` on each event. If the function returns a truthy value, it is emitted downstream. Please [read these notes](/features/adhoc-code/#this-context) for details on arrow functions and `this`. ## Config **Required:** - `function`: Function to apply to events. ## Example ```yaml pipeline: not-aggregated: module: js config: function: !!js/function >- function(event) { if (event._agg === undefined) { return event } } ```