2.0.3 • Published 2 months ago

@stormking/emere v2.0.3

Weekly downloads
-
License
ISC
Repository
gitlab
Last release
2 months ago

Emere

Small tool to retrieve HTML or PDF from a loaded webpage with electron.

Works as a minimal replacement for nightmare.js since it hasn't been getting updates for years.

Usage

See src/main.test.ts for more examples.

import run from 'emere';

let bufferWithHtml = await run({
	url: 'http://example.org',
	waitForSelector: 'h1'
});

Options API

type RunScript = {
	url: string,								//webpage to call
	header?: Record<string, string|string[]>,	//headers to send when loading
	body?: string,								//request body to send
	method?: string,							//HTTP method to use
	referrer?: string,							//HTTP referrer to set
	waitAfterLoad?: number,						//wait for ms before grabbing the page. still respects timeout
	waitForSelector?: string,					//wait up to the timeout until this element appears on the page
	userAgent?: string,							//user-agent to set
	timeout?: number,							//timeout for the whole process. will kill electron process
	get?: 'html'|'pdf'							//defaults to html when not set
}
2.0.3

2 months ago

2.0.2

6 months ago

2.0.1

2 years ago

2.0.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago