
Security News
Free Certified Patch for Critical Rails Active Storage Vulnerability
Socket has released a free Certified Patch for a critical Rails Active Storage vulnerability, giving developers time to upgrade to a secure Rails version.

shashin (japanese: photograph) takes beautiful photos of websites in any
resolution using PhantomJS.
It is heavily inspired by pageres but
shashin has a much simpler API.
npm install shashin --save
var fs = require('fs');
var shashin = require('shashin');
var info = shashin('google.com', '1024x768', { delay: 1, crop: true });
var file = fs.createWriteStream('screenshot.png');
// Don't forget to handle errors
info.stream.on('error', function (err) {
console.error(err);
});
info.stream.pipe(file);
info = shashin(url, resolution, options)Either a full URL to the website, just a domain name, or a local file path.
A string like "1024x768" that represents the browser window size, or an array
with 2 entries like [1024,768], or an object like { width: 1024, height: 768}, or any device identifier supported by
viewportsizes (see
viewportsizes.com)
Type: number
Default: 0
Delay in seconds before taking the screenshot after the page has loaded.
Type: boolean
Default: false
If true the screenshot will be cropped to the viewport size.
Type: string
Default: null
A CSS selector to capture only a specific DOM element.
Type: number
Default: 1
Zoom factor of the page, zoom factor is zoom percent / 100, so 2 represents 200%.
Tye: number
Default: 30
Number of seconds until the request times out.
Tye: number
Default: 30
Number of seconds until the PhantomJS process is killed in case it hangs.
Type: boolean
Default: false
If true uses SSL/TLS protocol if not present in the url.
Returns an object with all the necessary information to identify the screenshot and retreive the image data:
Type: string
A hash of the internal instructions. Useful for file names or caching.
Type: string
The full URL to the captured site.
Type: number
Viewport width in pixels.
Type: number
Viewport height in pixels.
Type: boolean
Whether the image was cropped.
Type: number
Delay in seconds.
Type: string
CSS selector used to capture a specific element.
Type: number
The zoom factor.
Type: Class: stream.Readable
A readable stream that provides the binary image data in PNG format.
FAQs
Capture responsive screenshots using PhantomJS
We found that shashin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.

Security News
Socket has released a free Certified Patch for a critical Rails Active Storage vulnerability, giving developers time to upgrade to a secure Rails version.

Security News
/Threat Research
A malicious Ruby gem runs a credential-stealing worm during installation, poisons AI coding tools, and can wipe files when a stolen GitHub token is revoked.

Security News
GitHub is tightening GitHub Actions security with new restrictions on privileged pull request workflows. Here's what changes and how maintainers are affected.