page2image: npm package for taking screenshots which also provides CLI command
github.com