💛 You can help the author become a full-time open-source maintainer by sponsoring him on GitHub.
npm i node-apikit
NOTE: this library requires a fetch
polyfill if you're running it in Node.js. Despite being named node-apikit
, it actually supports browser and Deno too.
getHTML
Get HTML for specific URL:
import { getHTML } from 'node-apikit'
const html = await getHTML(url)
Arguments:
url
: URLoptions
:
js
: boolean
Run JavaScript on this page, default to false
screenshot
Screenshot specific URL:
import { screenshot } from 'node-apikit'
const { getBuffer } = await screenshot(url)
const arrayBuffer = await getBuffer()
Arguments:
url
: URLoptions
:
fullPage
: boolean
screenshot the full page, default to false
getRealURL
Get the final URL, i.e. after redirection.
import { getRealURL } from 'node-apikit'
const url = await getRealURL(url)
Arguments:
url
: URLseo
Get SEO information for specific URL:
import { seo } from 'node-apikit'
const info = await seo(url)
Arguments:
url
: URLoptions
:
js
: boolean
Run JavaScript on this page, default to false
Returns:
interface Info {
title?: string
description?: string
image?: string
og: {
title?: string
description?: string
image?: string
}
twitter: {
creator?: string
site?: string
title?: string
description?: string
image?: string
}
}
MIT © EGOIST