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

onyx-toolbox

v0.2.0

Published

Environment tools for the [Onyx server](https://github.com/MainframeHQ/onyx-server)

Downloads

8

Readme

Onyx toolbox

Environment tools for the Onyx server

Prerequisites

Node v8+ with npm.

Installation

npm install --global onyx-toolbox

CLI

Usage
  onyx <command>

Commands
  clean - Clean the environment created by the setup
  help <command> - Information and available flags for the specified command
  reset - Reset the environment, same as clean + setup
  setup - Setup the environment
  start - Start the Onyx server
  status - Display the environment and processes status
  stop - Stop the Onyx server
  swarm <action> - Swarm commands

API

Static configuration

The values of the onyx Object from the package.json file are exposed in the public API.

conf: Conf

The Conf instance holding the dynamic toolbox configuration and local state.

getPath(key: string): string

Returns the path matching the provided key, if set.

Supported keys

  • geth.bin: the geth executable
  • server.bin: the onyx-server executable
  • swarm.bin: the swarm executable
  • swarm.data: the Swarm data folder
  • swarm.git: the go-ethereum git folder
  • swarm.pwd: the Swarm account password file
  • swarm.root: The Swarm folder, holding all the others

setPath(key: string, value: string): void

Sets the path for the specified key. See above for the list of keys used by the toolbox.

setPaths({[key: string]: string}): void

Sets multiple paths. See above for the list of keys used by the toolbox.

resetPaths(): void

Resets the paths used by the toolbox.

isSetup(): boolean

Returns whether the environment is setup or not.

checkGit(): Promise

Checks if git is installed in the environment.

checkGo(): Promise

Checks if Go is installed in the environment.

gitClone(cwd: string): Promise

Runs git clone in the provided cwd directory to download the supported go-ethereum repository.

gitFetch(cwd: string): Promise

Runs git clone in the provided cwd directory to retrieve the supported go-ethereum branch.

gitFetch(cwd: string): Promise

Runs git fetch in the provided cwd directory. The provided path should be the one of the go-ethereum repository downloaded using gitFetch().

buildBin(cwd: string, name: string): Promise

Builds the binary from the go-ethereum repository provided by the cwd argument and identified by the provided name. Supported names are geth and swarm.

createAccount(): Promise

Creates a new BZZ account and returns its address.

createPassword(password?: string): Promise

Creates a password file containing the provided password or a default one.

getServerStatus(): ?{ pid: number, port: number }

If the Onyx server is running, returns an Object containing the process pid and server port.

getSwarmStatus(): ?{ pid: number }

If Swarm is running, returns an Object containing the process pid.

startSwarm(options = {}): Promise<false | number>

Attempts to start the Swarm process with the provided options. Returns the process pid or false if it fails.

stopSwarm(): Promise<boolean | number>

Attempts to stop the Swarm process. Returns false if the process doesn't seem to be running, true if the process can be killed, or the process pid if it fails.

cleanSwarm(): Promise

Deletes the existing local state and removes the Swarm directory with all its contents.

startServer(options = {}): Promise<false | {pid: number, port: number}>

Starts the Onyx server with the provided options. Returns false if it fails to start the server, or an Object containing the server pid and port.

stopServer(): Promise<boolean | number>

Attempts to stop the Onyx server. Returns false if the process doesn't seem to be running, true if the process can be killed, or the process pid if it fails.

License

MIT.
See LICENSE file.