npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@sugarcube/plugin-http

v0.42.1

Published

HTTP related plugins for sugarcube.

Downloads

56

Readme

@sugarcube/plugin-http

Plugins based on HTTP requests.

Installation

npm install --save @sugarcube/plugin-http

Plugins

http_import

Import queries of query type http_url as Sugarcube units. The unit only contains the URL as location field. The MIME type of the url is determined and set in _sc_media so that other plugins can do further transformations on the unit.

Import of regular websites are done using a browser session (based on the Adapting the Hypercube Model to Archive Deferred Representations and Their Descendants paper by Justin F. Brunelle, Michele C. Weigle and Michael L. Nelson). Imports of other types (e.g. documents) are done using simple HTTP requests.

Configuration:

  • http.import_parallel: Specify how many HTTP URL's to import at the same time. It defaults to 1 and can be set between 1 and 8.

Example:

The following example imports a website and extracts the contents from it. Any images found are fetched as well and finally it creates a WARC archive and takes a screenshot.

$(npm bin)/sugarcube -p http_import,media_fetch,media_warc,media_screenshot \
                     -Q http_url:'https://mwatana.org/en/airstrike-on-detention-center/' \
                     --http.import_parallel 2

Metrics:

  • total: The total number of queries imported.
  • success: The number of URLs that were successfully imported.
  • fail: The number of URLs that failed to import.

http_get (DEPRECATED)

This plugin is deprecated in favor of the media_fetch plugin.

Fetch images, files, pdf's and videos from _sc_data. Downloaded targets are added to the _sc_downloads collection.

Configuration Options:

  • http.data_dir (defaults to ./data)

    Specify the target download directory.

  • http.get_types (defaults to "image,file,pdf,video")

    Fetch files of this media type. Separate different types using a comma.

Metrics:

  • total: The total number of files fetched.
  • existing: The number of files that were already previously fetched.
  • success: The number of files that were successfully fetched.
  • fail: The number of files that were failed to download.

http_wget

Fetch whole web pages from _sc_media. Downloaded targets are added to the _sc_downloads collection.

Configuration Options:

  • http.data_dir (defaults to ./data)

    Specify the target download directory.

  • http.wget_cmd (defaults to wget)

    Specify the path to the wget command.

Feature flags

  • ncube sets the new and Ncube compatible data format. This is still optional but will become the new default in the future.
$(npm bin)/sugarcube -p http_import \
                     -Q http_url:'https://mwatana.org/en/airstrike-on-detention-center/' \
                     -D ncube

License

GPL3 @ Christo