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

com.mostajs.netclient

v0.1.0

Published

Unity package — talks to @mostajs/net servers. Shares the wire contract with the .NET / Java / Python / TS ports. Works on Mono/IL2CPP, Standalone, iOS, Android, WebGL (via UnityWebRequest fallback).

Downloads

177

Readme

@mostajs/net — Unity client (UPM package)

Auteur : Dr Hamid MADANI [email protected] Licence : AGPL-3.0-or-later + licence commerciale disponible UPM name : com.mostajs.netclient:0.1.0 Target : Unity 2020.3 LTS and up — Mono & IL2CPP, Standalone, iOS, Android, WebGL

Unity-native client for @mostajs/net.

Two flavours are available to you inside a Unity project :

| Layer | File(s) | When to use | |---|---|---| | Vanilla .NET (HttpClient) | Drop MostaJs.Net.Client.dll (netstandard2.0) into Assets/Plugins/ | Standalone, mobile (Mono/IL2CPP). Idiomatic async/await — same API as the NuGet package | | Unity-specific (UnityWebRequest) | Shipped here as UnityWebRequestNetClient.cs | WebGL (HttpClient cannot block the main thread), or any code path where you prefer coroutines |


Install

Option A — Package Manager (OpenUPM-style)

Window → Package Manager → + → Add package from git URL
  → https://github.com/apolocine/mosta-net-client-unity.git

Option B — Manual UPM

Edit Packages/manifest.json :

{
  "dependencies": {
    "com.mostajs.netclient": "https://github.com/apolocine/mosta-net-client-unity.git#0.1.0"
  }
}

Option C — DLL only (for HttpClient-based API)

Download MostaJs.Net.Client.0.1.0.nupkg from NuGet, extract the lib/netstandard2.0/MostaJs.Net.Client.dll, drop it into Assets/Plugins/ of your Unity project.


Quick start — coroutine (WebGL safe)

using UnityEngine;
using MostaJs.Net.Client.Unity;

public class Demo : MonoBehaviour
{
    private UnityWebRequestNetClient _net;

    private void Start()
    {
        _net = new UnityWebRequestNetClient("http://localhost:4488", "sk_dev_local");

        StartCoroutine(_net.Health((ok, err) => Debug.Log($"reachable: {ok}")));

        StartCoroutine(_net.FindAll("User", null, (body, err) =>
        {
            if (err != null) Debug.LogError(err);
            else             Debug.Log($"users: {body}");
        }));
    }
}

(See the Quick Start sample : Window → Package Manager → MostaJs Net Client → Samples → Import.)

Quick start — async/await (Standalone, mobile only)

On IL2CPP / Mono Standalone platforms you can use the vanilla .NET client bundled as the plugin DLL :

using MostaJs.Net.Client;

async void Start()
{
    using var net = NetClient.Create()
        .UrlOf("http://localhost:4488")
        .WithApiKey("sk_dev_local")
        .Build();

    if (await net.HealthAsync())
    {
        var users = await net.FindAllAsync<Dictionary<string, object>>("User");
        Debug.Log($"loaded {users.Count} users");
    }
}

Same signatures as in the C# README (../mosta-net-client-dotnet/README.md). The only difference on Unity : avoid it on WebGL builds — use UnityWebRequestNetClient instead.


Schema registration

Same 6-step flow as every port. With coroutines :

IEnumerator RegisterUserSchema()
{
    var net = new UnityWebRequestNetClient(serverUrl, apiKey);

    yield return net.Health((ok, err) => { /* verify */ });

    var schemaJson = @"{""schemas"":[{""name"":""User"",""collection"":""users"",
                                     ""timestamps"":true,
                                     ""fields"":{""email"":{""type"":""string"",""required"":true}}}]}";

    yield return net.UploadSchemasJson(schemaJson, (body, err) =>
    {
        Debug.Log($"upload result: {body}");
    });

    // After the server's self-restart (~2-5 s), poll /health + /api/schemas-config
    // until the entity appears. In Unity you'd do it with a while + yield return
    // new WaitForSeconds(1).
}

For the complete flow diagram and pitfalls see Entreprise/multi-runtime/SUIVI-PORTS-POLYGLOTTES-20260424.md §3.


API surface (UnityWebRequest flavour)

Every method is a coroutine (IEnumerator) that yields the HTTP call and invokes a NetCallback<T> when done.

| Method | Callback payload | |---|---| | Health(cb) | bool ok | | FindAll(collection, filterJson, cb) | string rawJsonBody | | FindById(collection, id, cb) | string rawJson (null on 404) | | Create(collection, jsonBody, cb) | string rawJson | | Update(collection, id, jsonBody, cb) | string rawJson | | Delete(collection, id, cb) | bool ok (false on 404) | | GetSchemasConfig(cb) | string rawJson | | UploadSchemasJson(schemasJsonBody, cb) | string rawJson |

All bodies are returned as raw JSON string — use JsonUtility, Newtonsoft.Json or System.Text.Json to deserialise.


Why two flavours ?

HttpClient on Unity :

  • ✅ Works on Standalone, Mono desktop, IL2CPP mobile
  • ❌ Blocks or throws on WebGL (main-thread constraints of the browser)
  • ⚠️ Requires .NET Standard 2.1 mode or later versions of the API Compatibility Level

UnityWebRequest :

  • ✅ Works everywhere Unity builds — including WebGL, Consoles, XR
  • ✅ Coroutine-friendly, integrates naturally with StartCoroutine
  • ❌ Slightly more verbose than async/await
  • ❌ No built-in cancellation beyond stopping the coroutine

If in doubt, use UnityWebRequestNetClient — it is guaranteed to compile on every Unity target.


Relation to the @mostajs ecosystem

Unity joins the family alongside the vanilla .NET (NuGet) port and shares the same wire contract.

  Node / TS   Java    C#/.NET   Delphi   Python   Go   Swift   Kotlin   Dart
     │          │        │         │        │     │     │        │        │
     └──────────┴────────┴─────────┴────────┴─────┴─────┴────────┴────────┘
                                 │
                                 ▼
                     @mostajs/net  — shared wire contract
                                 │
                                 ▼
                               Unity   ◀── this package

Licence

AGPL-3.0-or-later. Commercial licensing : [email protected].