Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

storysnap

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

storysnap

A navigation and CSS regression utility based on headless Chrome.

  • 2.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
increased by600%
Maintainers
1
Weekly downloads
 
Created
Source

Storysnap

A CSS regression utility for Storybook based on headless Chrome.

Install

  • You must have Chrome >= 59 installed on the machine where this script is running.*

npm i storysnap

You can also install it globally using '-g' flag and access it as simply storysnap.

Usage

Storysnap provides a CLI and also a programatic way to use it.

CLI usage

storysnap --output ./screenshots

The arguments are as follows:

  1. --output - (Optional) Location where the screenshots taken during nav will be saved.
  2. --port ( Default to 6006 ). The port on which Storybook runs or will be started
  3. --host ( Default localhost). The host on which Storybook will be started.
  4. --autostart ( Default false). Whether Storysnap should spin off a new instance of React Storybook instead of connecting to an already existing instance
  5. --bin - Indicated the location of the start-storybook binary. Used only if autostart is true.
  6. --config-dir ( Default .storybook ). The directory where the Storybook configuration resides.
  7. --concurrency ( Defaults to max number of CPUs availabl ). How many parallel workers to use for screenshots.

Programatic usage

There are 2 functions being exported by the package that can be used in a NodeJS app:

  • storysnap(options) - Returns a promise that is resolved when the screenshots have been taken. Options is an object similar to CLI options, but with keys camel cased( eg { output: 'screenshot', configDir: '.storybook'}).
  • startStorybookServer(options) - Programatically start a Storybook server. Returns a Promise that it's resolved when the server started.
const {storysnap} = require('storysnap');
storysnap({
    output: './screenshots',
    port: 6006,
    host: 'localhost',
    autostart: true
});

FAQs

Package last updated on 24 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc