Socket
Socket
Sign inDemoInstall

jsx2jpg

Package Overview
Dependencies
13
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    jsx2jpg

A tool for taking screenshots of JSX component files.


Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

⚛️ jsx2jpg 🖼️

A tool for taking screenshots of JSX component files.

Quick Start

Install the library:

$ npm install -g jsx2jpg

Install its peer dependencies:

$ npm install -g react react-dom react-helmet

Use the library:

$ jsx2jpg snap App.jsx

See Examples below for more.

CLI Reference

Snap

The snap command (currently the only command in this library takes a screenshot of a React component).

Show help message:
$ jsx2jpg snap --help
Calling format and available options:
jsx2jpg snap <component> [context]

Takes a screenshot of a component.

Positionals:
  component   A path to a JSX file.                          [string] [required]
  context, c  A path to an importable data file.                        [string]

Options:
  --version           Show version number                              [boolean]

  --help              Show help                                        [boolean]

  --size, -s          A sizing string for width/height
                                                   [string] [default: "600x325"]

  --destination, -o   The destination directory          [string] [default: pwd]

  --quality, -q       The quality (from 0 to 100)        [number] [default: 100]

  --resolution, -r    A resolution multiplier              [number] [default: 1]

  --fileAccessor, -a  Accessor for filename if multiple contexts
                                                        [string] [default: "id"]

  --filename, -n      Name of file if single context
                                                 [string] [default: "share.jpg"]

  --verbose, -v       Whether to log updates in the console
                                                       [boolean] [default: true]

  --cleanup, --cu     Whether to delete the .tmp directory
                                                       [boolean] [default: true]

Examples

FAQs

Last updated on 14 Nov 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc