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

@nateflynn/webpack-wordpress-theme-version-sync

v1.0.0

Published

Easily sync your WordPress theme version with your project's `package.json` file unsing Webpack

Readme

Nate Flynn

Webpack WordPress Plugin Version Sync

Easily sync your WordPress plugin version with your project's package.json file


Installation

Install the package as a dev dependency

npm i @nateflynn/webpack-wordpress-plugin-version-sync --save-dev

This package assumes that your code will run in an ES2015+ environment.


Getting Started

Add the following requirement to your Plugin's webpack.config.js file:

const path = require("path");
const WebpackWordPressPluginSync = require("@nateflynn/webpack-wordpress-plugin-version-sync");

module.exports = {
    plugins: [
        new WebpackWordpressPluginSync({
            configFile: path.resolve( __dirname, 'config.json' ),
            outputFile: path.resolve( __dirname, 'index.php' ),
            replacements: {
                '{VERSION}': process.env._npm_package_version
            },
            addNewlineAfter: false
        })
    ]
}

Options

| Name | Type | Default | Description | | ---- | ---- | ------- | ----------- | | configFile | {string} | config.json | Absolute path to the plugin's config.json file | | outputFile | {string} | index.php | The output location for the plugin's main file. By default this is the index.php file found at the root of your plugin directory, but this may be changed to a filename that represents your plugin name instead. | | replacements | {object} | { '{VERSION}' : process.env.npm_package_version } | An object containing key / value pairs of values to be replaced within your config.json file. Using this you can define your own placeholders that will be replaced when your config file is parsed. | | addNewlineAfter | {boolean} | false | When set to true will ensure a newline is added directly after the file header when it's generated. |

Plugin Config

In order to compile updated headers, your plugin will need a config.json file. This file simply contains the header data you would usually find at the top of your plugins's main PHP file. By default this should be found at root of your plugin directory.

A typical config.json file will look like the following:

{
    "Plugin Name": "My Awesome Plugin",
    "Plugin URI": "https://mywebsite.com",
    "Description": "A super awesome WordPress Theme that automatically keeps track of version.",
    "Version": "{VERSION}",
    "Requires at least": "5.8",
    "Requires PHP": "7.4",
    "Author": "Nate Flynn",
    "Author URI": "https://github.com/nateflynn-silktide",
    "Text Domain": "mytextdomain",
    "Domain Path": "/languages",
    "License": "GPL v3 or later",
    "License URI": "http://www.gnu.org/licenses/gpl-3.0.txt",
    "Update URI": "https://mywebsite.com/myplugin/"
}

If you want to add PHPDoc DocBlock to your plugin header, you can do so by updating the config like so:

{
    "@package": "MyAwesomePlugin",
    "@author": "Nate Flynn",
    "@copyright": "2022 Nate Flynn",
    "@license": "GPL-3.0-or-later",

    "@wordpress-plugin": "",
    "Plugin Name": "My Awesome Plugin",
    "Plugin URI": "https://mywebsite.com",
    "Description": "A super awesome WordPress Theme that automatically keeps track of version.",
    "Version": "{VERSION}",
    "Requires at least": "5.8",
    "Requires PHP": "7.4",
    "Author": "Nate Flynn",
    "Author URI": "https://github.com/nateflynn-silktide",
    "Text Domain": "mytextdomain",
    "Domain Path": "/languages",
    "License": "GPL v3 or later",
    "License URI": "http://www.gnu.org/licenses/gpl-3.0.txt",
    "Update URI": "https://mywebsite.com/myplugin/"
}

Notice the Version number has been replace with the keyword {VERSION}. Technically, this can be any string you want, this value will be replaced each time your project is rebuilt.

Note: This config makes use of PHPDoc DocBlock file headers as well as WordPress Plugin file headers. You can add any DocBlock headers you need to your config as long as they appear before the @wordpress-plugin property.

If you do use DocBloc properties, the @wordpress-plugin property should be

If you don't need DocBlock headers in your plugin, you can omit the @wordpress-plugin property from your config.