New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

styleguidist-scrapper

Package Overview
Dependencies
Maintainers
4
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

styleguidist-scrapper

Scrapper script for documentation generated by https://react-styleguidist.js.org/

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

styleguidist-scrapper

This is a scrapper script targeting documentation generated by react-styleguidist.

It's main purpose is to generate metadata of documented examples which can be used to generate visual snapshot tests using jest, jest-image-snapshot and puppeteer.

API

scrape(styleguideUrl: string): Promise<Array<ExampleMetadata>>

Types

ExampleMetadata

type ExampleMetadata = {
  // component name
  component: string,
  // directory where it is located
  dir: string,
  // URL with isolated example
  url: string,
  // title for the example
  // assumed to be paragraph above the example
  title: string,
  // CSS selector for the example
  // useful for targeting screenshots
  selector: string,
}

Usage

const fs = require('fs')
const scrape = require('styleguidist-scrapper')

scrape('http://localhost:6060').then(examples => {
  fs.writeFile('./examples-metadata.json', JSON.stringify(examples), 'utf8')
})

Keywords

FAQs

Package last updated on 01 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