slim.js 836 B

12345678910111213141516171819202122
  1. /**
  2. * @file Alternative entry point for Cheerio that always uses htmlparser2. This
  3. * way, parse5 won't be loaded, saving some memory.
  4. */
  5. import { getLoad } from './load.js';
  6. import { getParse } from './parse.js';
  7. import render from 'dom-serializer';
  8. import { parseDocument } from 'htmlparser2';
  9. export { contains, merge } from './static.js';
  10. /**
  11. * Create a querying function, bound to a document created from the provided
  12. * markup.
  13. *
  14. * @param content - Markup to be loaded.
  15. * @param options - Options for the created instance.
  16. * @param isDocument - Always `false` here, as we are always using
  17. * `htmlparser2`.
  18. * @returns The loaded document.
  19. * @see {@link https://cheerio.js.org#loading} for additional usage information.
  20. */
  21. export const load = getLoad(getParse(parseDocument), render);
  22. //# sourceMappingURL=slim.js.map