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

cncnet-map-downloader.js

v2.3.0

Published

Downloads all maps from cncnet

Downloads

22

Readme

npm

cncnet-map-downloader.js

Downloads all maps from cncnet.org into a directory of your choice.

Usage

Grab the latest binary release on the release page 💽.

Double-click your favorite executable (win, mac, linux).

  • By default, it only downloads Yuri (yr) maps, but can be configured to download other types. See config below.
  • If the process is somehow killed, it will resume downloading maps that haven't been downloaded yet (skips previously downlaoded maps).
  • It sorts maps in directories by name (alpha numeric).
  • It checks for duplicate maps (size, id, sha).

| Windows preview | Mac preview | | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | | | |

Build it yourself

Clone the repo, then run npm install. You can start a download with npm run download. Downloads can be configured in package.json under scripts.

Configuration

You can configure the downloader through enviornment variables.

  • MAP_AGE - the age of the map in months (default: not specified - will get all). Example: 12 will get maps that are 1 year old and newer.
  • GAME_TYPE - the type of maps to download (default: yr). Available: ts, ra, d2, td, dta.
  • DESTINATION_DIR - the location to download files (default: cncnet-maps).

Configuration examples

  • Get all Yuri's Revenge / Red Alert 2 maps in a custom directory
DESTINATION_DIR=my-yuri-maps ./cncnet-map-downloader-js-x-x-x-macos
  • Get all Red alert maps
GAME_TYPE=ra ./cncnet-map-downloader-js-x-x-x-macos
  • Get all Tiberian Sun maps, not older than 1 year
GAME_TYPE=ts MAP_AGE=12 ./cncnet-map-downloader-js-x-x-x-macos
Dev config
  • RUN_UNPACKAGED - run the script in unpacked mode[1] (default: false; see npm run download in package.json for an example).
  • DEBUG - print additional debug info.

[1] essentially, run the non-binary script. Requires node v12.9+ & npm install

About the method

Uses the cncnet search endpoint to retrieve all existing maps, then requests each map zip individually with a delay to be nice on the server.

Previously, scarping was considered, but not necessary at this point in time.

Debugging

Run

DEBUG=true MAX_NUMBER_OF_MAPS=5 REQUEST_DELAY=5000 MAP_AGE=1 RUN_UNPACKAGED=true GAME_TYPE=yr DESTINATION_DIR=./cncnet-yuri-maps node --inspect-brk ./scripts/main.js

And open chrome://inspect to debug the node process.

Other art

Check out the cncnet search, where you can search and download maps.