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

ethpm-spec

v3.0.0

Published

Ethereum Package Manager Specifications

Downloads

1,201

Readme

EthPM Package Specification

Overview

Join the chat at https://gitter.im/ethpm/Lobby

This repository comprises the formal specification and documentation source for the EthPM package manifest data format.

This data format is designed to be produced/consumed by Ethereum development tools. As such, this repository is intended for tool developers wishing to integrate with EthPM.

Package manifests are JSON-encoded, tightly-packed, with objects’ keys sorted in lexicographic order. Package manifests may live on disk, but are intended to be produced programmatically and uploaded directly to a content-addressable storage network (e.g. IPFS). A package manifest describes a single package, including package name, version, dependencies, and references to distributed source files.

Repository Contents

Examples / Use Cases

Package: owned (prettified)

{
    "name": "owned",
    "version": "1.0.0",
    "manifest": "ethpm/3",
    "meta": {
        "license": "MIT",
        "authors": [
            "Piper Merriam <[email protected]>"
        ],
        "description": "Reusable contracts which implement a privileged 'owner' model for authorization.",
        "keywords": [
            "authorization"
        ],
        "links": {
            "documentation": "ipfs://QmUYcVzTfSwJoigggMxeo2g5STWAgJdisQsqcXHws7b1FW"
        }
    },
    "sources": {
        "contracts/Owned.sol": {
            "type": "solidity",
            "urls": [
                "ipfs://Qme4otpS88NV8yQi8TfTP89EsQC5bko3F5N1yhRoi6cwGV"
            ],
            "installPath": "./contracts/Owned.sol"
        }
    }
}

Please see Use Cases for documented examples of different kinds of packages with varying levels of complexity. Source for use case examples can be found in the examples/ directory of this repository.

Each example directory contains..

  • 1.0.0.json: ethpm v2 manifest (deprecated)
  • 1.0.0-pretty.json: ethpm v2 manifest (pretty printed) (deprecated)
  • v3.json: ethpm v3 manifest
  • v3-pretty.json: ethpm v3 manifest (pretty printed)
  • contracts/: Directory containing the source contracts for the example
  • metadata/: Directory containing example ethpm compliant compiler metadata output for each example contract

Specification

The EthPM package manifest format is formally specified as a JSON-Schema.

Please see Package Specification for a natural-language description of this schema, or see package.spec.json for the machine-readable version.

Contributing

Requirements: Python 3, pip, make Fork and clone this repo to get started. Then, activate a virtual environment in the cloned repo's directory and run pip install -r requirements.txt

Building Sphinx docs locally

  1. cd docs
  2. make html

Docs are written in reStructuredText and built using the Sphinx documentation generator.

Running tests locally

  1. pytest tests/

Test fixture schema

Each test fixture contains a package field with a raw, json encoded string of the manifest.

Each test fixture contains a testCase field that indicates whether the associated package is invalid or valid.

Each invalid test fixture contains an errorInfo field.

  • The errorPointer field, which is a jsonpointer pointing towards the cause of the invalid error, is included for invalid tests.
  • The reason field, which is a human readable description of the error, is included for invalid tests.
  • The errorCode field, which is a machine readable description of the error, is included for invalid tests according to the following table.

N0001 - Invalid "manifest" field. N0002 - Invalid "name" field. N0003 - Invalid "version" field. N0004 - Invalid "sources" field. N0005 - Invalid "contractTypes" field. N0006 - Invalid "deployments" field. N0007 - Invalid "compilers" field. N0008 - Invalid "buildDependencies" field. N0009 - Invalid "meta" field.