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

@internetarchive/cdxsummary

Package Overview
Dependencies
Maintainers
15
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@internetarchive/cdxsummary

A Web Component to render CDX Summary JSON files

  • 0.2.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
21
increased by61.54%
Maintainers
15
Weekly downloads
 
Created
Source

CDX Summary Web Component

Assuming that a CDX Summary JSON file is generated from CDX files or WARC collections using the cdxsummary CLI tool, use the following Web Component to render it as an interactive HTML markup.

<cdx-summary src="CDX_SUMMARY_JSON_URL"></cdx-summary>

Alternatively, render a summary from a web collection/item of Internet Archive's Petabox, if a corresponding summary file is generated already.

<cdx-summary item="PETABOX_ITEM_OR_COLLECTION_ID"></cdx-summary>

One of the src and item attributes is mandatory for the element to render.

By default, sample capture playback links (i.e., memento URIs or URI-Ms) point to https://web.archive.org/web/, but this can be customized by specifying the playback attribute. To control the maximum number of thumbnails of random sample captures (rendered by embedding them in iframes), specify a positive integer in the thumbs attribute. The list of random sample capture playback URIs are hidden by default, but can be expanded by setting the drawer attribute to open. The element accepts a name attribute, which defaults to the name of the summary file (without extensions). A type attribute can be used to customize textual descriptions with a value of collection, item, or CDX (defaults to CDX). A report attribute points to a comprehensive version of the summary file, which is derived from the item attribute for Petabox items/collections, unless specified explicitly. Number reported in various table cells can be formatted using format attribute with values short, percent, or local (defaults to local). The code below illustrates the usage of these attributes.

<cdx-summary src="https://example.org/files/covid-collection-cdx.summary.json"
             report="https://example.org/files/covid-collection-cdx.report.json.gz"
             type="collection"
             name="COVID-19 Collection"
             format="short"
             thumbs="10"
             playback="https://archive.example.com/memento/"
             drawer="open">
</cdx-summary>

An interactive test interface is available for the Web Component that renders the JSON summary.

Keywords

FAQs

Package last updated on 18 Jun 2022

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