New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@code4rena/botrace-utils

Package Overview
Dependencies
Maintainers
13
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@code4rena/botrace-utils

Various utilities for Code4rena Bot Races

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
13
Created
Source

Code4rena Botrace Utils

Various utilities for Code4rena Bot Races

Getting Started

Installation

Node.js 18 or higher is required.

Install via npm: npm i -g @code4rena/botrace-utils

Or use npx to run the package directly: npx @code4rena/botrace-utils --help

Command line

Once installed the c4bru command will be available. See c4bru --help for full usage.

JSON validation To validate a local file named report.json:

c4bru validate ./report.json

By default, this uses the currently recommended schema version. See the --help docs for how to change the target schema.

Markdown Rendering You can generate Markdown from your JSON report as it will be rendered for Github.

Note: Prior to generating the markdown the JSON report will be run through validation.

c4bru ./report.json > report.md

As a library

JSON validation

import {
  defaultVersion,
  schemas,
  validateReport,
} from "@code4rena/botrace-utils";

const validate = (reportJson) => {
  // Automatically use the default schema
  return validateReport(reportJson);
  // Or a specific version
  return validateReport(reportJson, schemas[defaultVersion]);
  return validateReport(reportJson, schemas["0.2.0"]);
};

Markdown Rendering Note: the api does not validate before rendering, it's recommended you run validation prior to rendering

import {
  renderReport,
} from "@code4rena/botrace-utils";

const toMarkdown = (reportJson, winningBotName) => {
  return renderReport(reportJson);
  // Optionally pass a bot name to include the winning report messaging
  return renderReport(reportJson, winningBotName);
};

FAQs

Package last updated on 13 Feb 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc