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

abuild

v0.0.11

Published

abuild

Downloads

52

Readme

abuild

A lightweight compilation tool suitable for file path changes, content replacement, and log generation.

Install

npm i -g abuild

OR

npm i abuild -D

Configuration

Step 1:

Create an abuild specific configuration file called abuild.config.js in the project root directory

Step 2:

The configuration file will ultimately return an object that can contain the following attributes:

1. Public Configuration Properties

  • preChangeLocalPath
// File matching rules that require changing the path before compilation
preChangeLocalPath: [
    {
        // {Boolean} Whether to directly replace the source file that needs to change the path before compilation: false - keep the source file (default), true - delete the source file
        isReplace: true,
        // Whether to add a hash to this file
        needFileHash: true,
        // {String} File directory or file path (limited range)
        path: '/client/dist/global.css',
        // {RegExp} File Regular Matching Rules
        from: /\/client\/dist\/(global\.css)/i,
        // {String|Function} The new path that needs to be changed can be a string or a function that can return a string
        // options.configCache: a k-v storage object for caching data during the compilation process
        // options.fileHash: fileHash will only be passed in as a parameter when needFileHash is true
        to: (options) => {
            const {configCache, fileHash} = options;
            configCache && (configCache.globalCssHash = fileHash);
            return `/client/dist/assets/${fileHash}.css`
        }
    }
]
  • ignoreRelease
// File matching rules without compilation (non-standard regular rules)
ignoreRelease: '*.sh,foutput.js,release.js,build.js,_build.js,debug.js,deploy.js,*.log,.gitignore,*config.js,*conf.js,*conf*.js,.vscode,/.DS_Store,/README.md,/{.git,config,doc,docs,html,mockup,node_modules,test,material,public,output,output-*,.DS_Store,build,client,client*}/**'
  • needReleasePath
// Path to files (or directories) that require special compilation (note: it is a path, not a matching rule)
// Generally, it is aimed at files or file directories that are included in the ignoreRelease rule but need to be extracted for compilation processing
needReleasePath: ['/client/dist/']
  • changePathRelease
// Regular matching rules for files that need to change paths
// The same file will be processed according to the last matching rule (try to avoid the same file being matched multiple times by different processing rules, which may lead to unexpected compilation paths)
changePathRelease: [
    // *.html -> /views/*.html
    {
        from: /\/client\/dist\/(.+?\.html)$/i,
        to: () => {
            return `/views/${RegExp.$1}`;
        }
    }
]

2. Compilation mode (debug | deploy)

  • debug - Debugging environment compilation mode configuration
// debug env
debug: {
    // Compilation Path
    deployPath: `../output/${siteName}/`,
    // File Content Replacement
    replace: {
        // Files that require content replacement (non-standard regular rules)
        files: '{package.json,package-lock.json,go.js,go*.js,*.html,/{lib,views}/**}',
        // Content Replacement Matching Rules - RegExp
        rules: [

            // client html content
            {
                from: /\.*\/*(assets\/global).css/gim,
                // {String|Function} The new path that needs to be changed can be a string or a function that can return a string
                // options.configCache: a k-v storage object for caching data during the compilation process
                // options.fileHash: fileHash will only be passed in as a parameter when needFileHash is true
                to: (options) => {
                    const { configCache } = options || {};
                    const { globalCssHash } = configCache || {};
                    return `/${RegExp.$1}.${globalCssHash}.css`
                }
            }
        ]
    }
}
  • deploy - Production environment compilation mode configuration
// production env
deploy: {
    // Compilation Path
    deployPath: `${deployPath}/latest_${dirName}`,
    // File Content Replacement
    replace: {
        // Files that require content replacement (non-standard regular rules)
        files: '{*.html,/{common,views}/**}',
        // Content Replacement Matching Rules - RegExp
        rules: [
            // client html content
            {
                from: /\.*\/*(assets\/global).css/gim,
                // {String|Function} The new path that needs to be changed can be a string or a function that can return a string
                // options.configCache: a k-v storage object for caching data during the compilation process
                // options.fileHash: fileHash will only be passed in as a parameter when needFileHash is true
                to: (options) => {
                    const { configCache } = options || {};
                    const { globalCssHash } = configCache || {};
                    return `/${RegExp.$1}.${globalCssHash}.css`
                }
            }
        ]
    },
    // Build log files that require additional content after compilation
    outputLog: {
        // {Boolean} true - append log(default), false - replace log
        isAdditional: true,
        // Log file path
        path: `${deployPath}/output.txt`,
        // {String|Function} A string or a function that can return a string
        log: () => {
            // for example
            return `, ${Date.now()}`
        }
    }
}

Usage

Compile using the abuild and its abuild.config.js configuration file:

// debug env
abuild debug

OR

// production env
abuild deploy