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 🙏

© 2026 – Pkg Stats / Ryan Hefner

forge-pack

v0.3.0

Published

Generate self-contained Solidity deployer files from Forge build artifacts

Readme

forge-pack

Generate self-contained Solidity deployer libraries from Forge build artifacts.

forge-pack reads your compiled contract JSON, resolves library dependencies, and outputs a single .sol file containing a deployer library with deploy(), deploy2() (CREATE2), and initcode() functions — ready to use in scripts or tests.

Usage

The package does not require installation, you can directly use npx/pnpx to run it:

npx forge-pack@latest <contract-name>

CLI Usage

forge-pack <ContractName> [options]

Options

| Flag | Description | Default | | ------------------ | ------------------------------------------ | ------------- | | --out <dir> | Forge output directory | ./out | | --output <dir> | Where to write the deployer .sol file | ./deployers | | --build | Run forge build before reading artifacts | false | | --pragma <range> | Solidity pragma for generated file | >=0.8.0 | | -h, --help | Show help message | — |

Example

# Generate a deployer for MyToken
forge-pack MyToken

# Build first, then generate with a specific pragma
forge-pack MyToken --build --pragma "^0.8.20"

# Use a custom output directory
forge-pack MyToken --output src/deployers

This produces a file like deployers/MyTokenDeployer.sol:

// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.0;

library MyTokenDeployer {
    function deploy(string memory name, string memory symbol) internal returns (address deployed) { ... }
    function deploy2(bytes32 salt, string memory name, string memory symbol) internal returns (address deployed) { ... }
    function initcode(string memory name, string memory symbol) internal pure returns (bytes memory) { ... }
}

Constructor parameters are automatically extracted from the ABI. Struct types used in constructor arguments get their definitions included in the generated file.

Library Dependencies

If your contract links against external libraries, forge-pack resolves them recursively in topological order and generates inline deployment helpers. The deployer handles deploying libraries before the main contract, so the output remains self-contained.

Programmatic API

import { findArtifact, parseArtifact, generateDeployer, resolveLibraries } from "forge-pack";

const artifactPath = findArtifact("MyToken", "./out");
const parsed = parseArtifact(artifactPath, "MyToken");

const libraries = resolveLibraries(parsed.linkReferences, "./out");
const solidity = generateDeployer(parsed, { pragma: ">=0.8.0", libraries });

Exports

Functions:

  • findArtifact(contractName, outDir, options?) — Locate a contract artifact in the Forge output directory
  • parseArtifact(artifactPath, contractName) — Parse a Forge artifact JSON into a structured object
  • resolveLibraries(linkReferences, outDir) — Recursively resolve library dependencies in deploy order
  • generateDeployer(parsed, options?) — Generate Solidity deployer library source code

Types: ParsedArtifact, LinkReference, LinkReferences, AbiParam, AbiEntry, FindArtifactOptions, ResolvedLibrary, GenerateDeployerOptions

License

MIT