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

create-acf-block

v0.7.3

Published

A CLI to register and scaffold an ACF block.

Readme

Create ACF Block

Register and scaffold your ACF blocks through a CLI

Read my blog post on why and how I created the create-acf-block CLI.

What this CLI does

The create-acf-block CLI registers your block within the acf_register_block_type() function, scaffolds a block render template, and optionally preps CSS and JS.

Usage


  1. Run npm i --save-dev create-acf-block

  2. Add these comments as markers in your block registration file. The CLI will register blocks only between these two comments.

// Begin Create-ACF-Block
// End Create-ACF-Block

Example:

function register_my_blocks() {

  // check function exists
  if( function_exists('acf_register_block_type') ) {
    // Begin Create-ACF-Block
    // End Create-ACF-Block

    // ... Other blocks you might have registered manually
  }
}
  1. Run npx create-acf-block

Preferences


When you first run the CLI, you'll set some basic preferences:

Block registration file path
The path to our ACF block registration file (where your acf_register_block_type() functions live.)
Example: ./inc/acf-blocks.php.

Render template folder path
The path to the folder where your ACF block render templates live. Example: ./blocks.

Create block specific CSS and JS files
Whether the CLI should scaffold CSS and JS files for your blocks.

Group block CSS and JS files with the render template Whether the CLI should place your CS and JS files in the same directory as your render template.

If no, your blocks will look something like:

./blocks
│   hero.php
│   quote.php
│
./css
│   hero.css
│   quote.css
./js
│   hero.js
│   quote.js

If yes, you'll provide the paths to your CSS and JS directories and your blocks will look something like:

./blocks
│
└───hero
│    │   block.php
│    │   block.css
│    │   block.js
└───quote
      │   block.php
      │   block.css
      │   block.js

General Flags


--preferences - Clear your preferences and set them again.

Block Detail Flags


When block flags are used, you will only be prompted to provide details for those flags. Note: name and title fields are required and will always be included in prompts.

--simple
Only prompts for the block name and title

--description
The block description

--category
The block category as seen in the editor

--mode
The default mode: [edit/preview/auto]

--align
The default block alignment

--jsx
Whether the block will use innerBlocks