taki

Install
yarn add taki
Usage
const taki = require('taki')
taki({ url: 'https://sao.js.org', wait: 1000 })
.then(result => {
console.log(result.window)
console.log(result.html)
})
Manually set ready state
If you have control of the website you want to prerender, you can manually call window.snapshot()
to tell taki
that your async web page is ready:
fetchSomeData().then(data => {
this.setState({ data }, () => {
window.snapshot && window.snapshot()
})
})
Resource filter
By default we fetch all resources in script
tag, but you can control which should be excluded:
const URL = require('url')
const url = 'http://example-website.com'
taki({
url,
resourceFilter(resource) {
return resource.url.host === URL.parse(url).host
}
})
See the resource definition here.
Canvas support
Install canvas or canvas-prebuilt alongside taki.
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Author
taki © egoist, Released under the MIT License.
Authored and maintained by egoist with help from contributors (list).
egoist.moe · GitHub @egoist · Twitter @rem_rin_rin