Skip to the content.

Callback Extractor Plugin

Back to Index

Extracts content using custom callback functions for maximum flexibility.

import { CallbackExtractorPlugin } from 'simple-docs-scraper/extractors';

const extractor = new CallbackExtractorPlugin({
  callback: (content) => {
    // Custom extraction logic
    const match = content.match(/\/\/ DOCS: (.*)/);
    return match ? match[1] : undefined;
  },
  searchAndReplace: '// DOCS'
});

Configuration: