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 🙏

© 2026 – Pkg Stats / Ryan Hefner

forge.json

v1.1.1

Published

Better and new $json and $array functions for ForgeScript.

Readme

ForgeJSON

Better and new $json and $array functions for ForgeScript. Discord IDs never lose digits, and leaderboards, pages and lists take a single function.


Contents

  1. Installation
  2. Functions
  3. What it fixes in ForgeScript
  1. Install the package.

    From npm - the stable release:

    npm i forge.json

    From GitHub:

    npm i github:Daaisukidayo/ForgeJSON#main

    It needs ForgeScript 2.4.0 and Node.js 22 or newer.

  2. Here's an example of how your main file should look:

    const { ForgeClient } = require("@tryforge/forgescript")
    const { ForgeJSON } = require("forge.json")
    
    const client = new ForgeClient({
        ...options, // Change that to the options you currently have
        extensions: [
            new ForgeJSON(),
            // Add other extensions you installed here
        ]
    })
    
    client.login("YourToken")

ForgeJSON replaces 37 of ForgeScript's functions. Existing calls keep working, and the differences are under Changed in functions.md.

⚠️ Warning
Lists saved before ForgeJSON hold their numbers as text. Search them with $arrayIndexOf[list;"10"], not $arrayIndexOf[list;10].

Every function is in functions.md, along with the Basics they share and Examples of whole commands.

| Group | Functions | What for | |---|---|---| | JSON functions | 14 | Reading, writing and checking any value. | | Object functions | 5 | Building objects and working with their keys. | | Array functions | 51 | Adding and removing, pages, random picks, sorting, sums, formatting and loops. |

Checked on @tryforge/forgescript 2.7.0 and 2.7.1:

| In ForgeScript | With ForgeJSON | |---|---| | $jsonLoad, $jsonSet, $arrayMap, $arrayPushJSON, $arrayUnshiftJSON and $arrayFill round long numbers, so the ID 123456789012345678 is stored as 123456789012345680. | IDs stay exact. | | Since 2.7.1, $arrayIncludes misses a long ID or a code like 007 that the list holds. | Both are found. | | $jsonLoad stores JSON that doesn't parse as plain text. When a ] cuts it short, the rest of it ends up in the message. | An object or array that doesn't parse is an error naming the likely cause. | | $arrayPush, $arrayUnshift, $arraySplice and $arrayLoad store numbers and booleans as text, so since 2.7.1 $arrayIncludes[list;5] misses the 5 they added. | Numbers and booleans are stored as such. | | $arrayIndexOf[list;5] and $arrayLastIndexOf[list;5] don't find the number in [5]. Neither did $arrayIncludes[list;5] before 2.7.1, and since then it disagrees with them. | All three compare by type. | | $arrayPush, $arrayUnshift, $arrayPushJSON, $arrayUnshiftJSON and $arraySplice silently do nothing when the variable holds something other than an array, or nothing yet. | A missing array is created, anything else is an error. | | $arrayJoin writes objects as [object Object]. | Objects are written as JSON. | | $jsonHas answers nothing, rather than false, for a missing variable. | It answers false. | | $jsonDelete on an array answers with the removed element, rather than true or false. | It answers true or false. | | The array loops leave their variables set once they end, overwriting any variable of the same name. | They are restored. | | $arrayEvery doesn't read its code as a condition, so $arrayEvery[list;x;$env[x]>0] gives false for any list that isn't empty. | The condition is read as in $if. | | $arrayReduce without a default value starts from null, not the 0 it promises, so adding up [1,2,3] with $math gives 5. | It starts from 0. | | $arrayShuffle makes some orders likelier than others. | Every order is equally likely. | | $arraySort sorts asc from the largest and desc from the smallest. Without a sort type it sorts numbers as text, so [10,9,1] becomes [1,10,9]. | asc and desc are the right way round, and numbers sort as numbers. | | $arrayFill puts one and the same object in every element, so changing one element changes them all. | Every element gets its own copy. | | $arrayRandomIndex gives 0 for an empty array. | It gives nothing. | | $arrayReverse[a;b] and $arraySort[a;b] change a as well, and make b the very same array. | b gets its own copy, and a stays as it is. |