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

phetscraper

v2.5.0

Published

Scraper and exporter of PHET simulations

Downloads

6

Readme

PhET Simulations scraper

This scraper creates offline versions in ZIM format of PhET science simulations for Science and Math.

npm

npm Docker CI CodeFactor Latest ZIM releases License

Requirements

It requires Node.js version 16 or higher.

Quick Start

npm i && npm start

The above will eventually output a ZIM file to dist/

Command line arguments

--withoutLanguageVariants uses to exclude languages with Country variant. For example en_CA will not be present in zim with this argument.

Available only on GET step:

--withoutLanguageVariants ...

Available on GET and EXPORT steps only:

--includeLanguages lang_1 [lang_2] [lang_3] ...
--excludeLanguages lang_1 [lang_2] [lang_3] ...

Available on EXPORT step only:

# Skip ZIM files for individual languages
--mulOnly

Example:

npm run get -- --includeLanguages en ru fr

Config

Another way to configure behaviour is through environment variables. Sample .env file (with default values):

# request per second, affects GET step only
PHET_RPS=8
# async workers on TRANSFORM step (keep it equal to number of CPU cores)
PHET_WORKERS=10
# number of retries on GET step (delay grow with exponential backoff)
PHET_RETRIES=5
# display verbose errors
PHET_VERBOSE_ERRORS=false

About

This project achieves multiple things:

  • Download PhET content
  • Generate an Index for said content
  • Generate ZIM file(s) containing content and index

Things this project does not yet do, but should:

  • Generate Android APK

Usage

The functionality is split into 5 npm scripts:

  • npm run setup - deletes state from previous runs
  • npm run get - downloads PhET simulations in specified languages
  • npm run transform - prepare the content and media files
  • npm run export - generates ZIM file(s)
  • npm start - runs all of the above in sequence

The steps get, transform and export have their own output directories:

  • get outputs HTML and PNG files to state/get
  • transform outputs intermediate files to state/transform
  • export outputs HTML and PNG files to state/export AND a ZIM file(s) to dist/

License

Apache or later, see LICENSE for more details.