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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@permaweb/loco

v0.0.21

Published

Develop and troubleshoot AO processes locally by loading a wasm module and interacting with it via a simple JS API.

Readme

AOS Local

Develop and troubleshoot AO processes locally by loading a wasm module and interacting with it via a simple JS API.

Requirements

  • Node 20+ (ESM only)
  • Always run with --experimental-wasm-memory64 (or set NODE_OPTIONS)

Install

npm i @permaweb/loco
# or
yarn add @permaweb/loco

Quick Start

import { aoslocal, SQLITE } from '@permaweb/loco'

async function main() {
  const aos = await aoslocal(SQLITE) // or omit for latest default
  await aos.src('./test/example.lua') // bundles local Lua requires automatically

  const evalRes = await aos.eval('Count = 1 + 1')
  const { Output } = await aos.send({ Action: 'Eval', Data: 'Count' })
  console.log(Output.data)
}

main()

Run with the memory flag (or export once):

NODE_OPTIONS="--experimental-wasm-memory64" node index.js

API

  • aoslocal(aosmodule = LATEST, env?) → Promise
    • aosmodule: use SQLITE, LLAMA, LATEST or an Arweave TX id
    • env: { Process, Module } defaults are provided for local dev
  • aos.src(srcFile, env?) → loads Lua source; packs require() graph into one
  • aos.eval(expr, env?) → AOS_Result for an Eval action
  • aos.send(message, env?) → AOS_Result; any extra fields become Tags
  • aos.load(processId) → loads latest checkpoint for a process
  • aos.fromCheckpoint(txId) → loads a specific checkpoint
  • aos.fromState(txId) → downloads VM memory from https://cu.ao-testnet.xyz/state/${txId} and loads it
  • aos.asOwner(processId) → derives default env from a live process
  • aos.fromOwner(txOrPid) → resolves Process from a state TX (if given), sets env

Types

// AOS_Message
Record<string, string>

// AOS_Result
{
  Output: { data: string },
  Messages: Record<string, any>[],
  Spawns: Record<string, any>[],
  Assignments: Record<string, any>[]
}

Checkpoints & Caching

  • Checkpoints are fetched from Arweave and cached as <txId>.bin in CWD
  • fromState fetches from the AO testnet state endpoint and also caches as <txId>.bin
  • Large files are streamed to disk; subsequent runs reuse the cache
  • Network is required for first load of module binary and checkpoints/state

Testing

  • All tests: npm test
  • Single file: npm test -- test/index.test.js
  • Name pattern: npm test -- --test-name-pattern="basic"

License: MIT