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

@operate/agent

v0.1.0-beta.1

Published

Operate JavaScript agent used to load and run Bitcoin programs.

Downloads

8

Readme

Operate | Agent (js)

Operate | Agent (js) is a JavaScript agent used to load and run programs (known as "tapes") encoded in Bitcoin SV transactions.

About Operate

Operate is a toolset to help developers build applications, games and services on top of Bitcoin (SV). It lets you write functions, called "Ops", and enables transactions to become small but powerful programs, capable of delivering new classes of services layered over Bitcoin.

More infomation:

Installation

Install using NPM:

npm install @operate/agent
const Operate = require('@operate/agent')

Or use in the browser via CDN (adds Operate to the global namespace):

<script src="//unpkg.com/@operate/agent@latest/dist/operate.min.js"></script>

Quick start

Aliases

To kick the styles, set up some aliases for common Bitcom protocol prefixes. This will allow you to load and run tapes from common services such as Bitpaste, Twetch, WeatherSV, Bit.sv and more.

Operate.config.quickStartAliases()

Load and run a tape

Operate can be used straight away to load and run tapes from transactions.

const tape = await Operate.loadTape(txid)
const result = await Operate.runTape(tape)

Operate always returns table structures from the Lua environment as a JavaScript Map. If preferred, these can be converted to an Object for easier data traversal and access.

Operate.util.mapToObject(result)

Beta software

This software should be considered beta. There are a few known issues and things that may change over time:

  • API changes. The current implmentation closely mirrors the design of the Elixir agent. Elixir and JavaScript semantics are quite different so over time the API design may change to reflect more idiomatic JavaScript styles.
  • Error handling sucks. If something goes wrong, especially in the Lua VM, the error you get back will almost certainly not be very useful. This will be improved over time.
  • Bundle size. The minimised bundle currently weighs in at over 700kb! I think it will be possible to get this under 300kb, but this will take work and time.

License

MIT License.

© Copyright 2020 Chronos Labs Ltd.