factorio-mods

An npm package to get stats for mods and users from mods.factorio.com

Usage no npm install needed!

<script type="module">
  import factorioMods from 'https://cdn.skypack.dev/factorio-mods';
</script>

README

factorio-mods

NPM

What is this?*

Factorio-mods is an npm package to fetch user and mod information from mods.factorio.com

Install

npm install --save factorio-mods

Usage

var Factorio = require('factorio-mods');

Mod Information


The main reason I made this was for the download stats.

Factorio.mod("bobassembly").then(function(info){
    console.log( JSON.stringify(info, null, 2) );
}, console.warn);

This will return the following information:

{
  "id": "bobassembly",
  "downloads": 452228,
  "updated": "a day ago",
  "versions": "0.13 - 0.17",
  "title": "Bob's Assembling machines ",
  "author": {
    "name": "Bobingabout",
    "link": "/user/Bobingabout",
    "id": "Bobingabout"
  },
  "license": "https://forums.factorio.com/viewtopic.php?f=51&t=28573",
  "summary": "Adds assembling machines 4, 5 and 6. And other machine higher tiers too.",
  "description": " ..long description.. "
}

User Information

Not much user information is available.

Factorio.user('Bobingabout').then(function(info){
    console.log( JSON.stringify(info, null, 2) );
}, console.warn);

Will return the following information:

{
  "id": "Bobingabout",
  "avatar": "https://www.gravatar.com/avatar/cfd17b18221b7ba34f097081d55c3a5e?s=192",
  "name": "Bobingabout",
  "downloads": 7373337,
  "mods": [
    {
      "id": "bobassembly",
      "image": "https://mods-data.factorio.com/assets/7c17c0832f43a643145cb4bc3ea7e1ba2625c493.thumb.png",
      "title": "Bob's Assembling machines",
      "link": "/mod/bobassembly",
      "summary": "Adds assembling machines 4, 5 and 6. And other machine higher tiers too.",
      "downloads": 452228,
      "versions": "0.13 - 0.17",
      "updated": "a day ago"
    }
  ]
}

If you have any bugs or issues please report them here