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 🙏

© 2025 – Pkg Stats / Ryan Hefner

simple_build_tools

v1.0.3

Published

Simple tools for building a nodejs project

Readme

Simple Build Tools

Simple tools for building a nodejs project

Functions

Typedefs

toProm(fcn) ⇒ Promise

Convert a callback executing asynchronouse function into a promise returning one

Kind: global function

| Param | Type | Description | | --- | --- | --- | | fcn | function | asynchronous function that executes a callback |

copyFile(src, dest) ⇒ Promise.<void>

Copy a single file

Kind: global function

| Param | Type | Description | | --- | --- | --- | | src | string | path to the source file | | dest | string | path to the destination file |

copyDir(src, dest) ⇒ Promise.<void>

Copy an entire directory

Kind: global function

| Param | Type | Description | | --- | --- | --- | | src | string | path to the source directory | | dest | string | path to the destination directory |

transformFile(src, dest, transform) ⇒ Promise.<void>

Copy and transorm a file

Kind: global function

| Param | Type | Description | | --- | --- | --- | | src | string | path to the source file | | dest | string | path to the destination file | | transform | function | text transforming funciton |

assertDir(dir) ⇒ Promise.<void>

Ensure that a directory exists

Kind: global function

| Param | Type | Description | | --- | --- | --- | | dir | string | the path to the directory that must exist |

assertParentDir(file) ⇒ Promise.<void>

Ensure that a file's parent directory exists

Kind: global function

| Param | Type | Description | | --- | --- | --- | | file | string | the path to the file whose parent must exist |

rmrf(path) ⇒ Promise.<void>

remove contents recursively

Kind: global function

| Param | Type | Description | | --- | --- | --- | | path | string | the path of the item to be removed |

runAndReport(task) ⇒ Promise.<void>

Run a build task and report it's time and result

Kind: global function

| Param | Type | Description | | --- | --- | --- | | task | function | a build task that should be timed and reported |

series(tasks) ⇒ Promise.<void>

join a set of tasks in series

Kind: global function

| Param | Type | Description | | --- | --- | --- | | tasks | Array.<function()> | tasks to join |

parallel(tasks) ⇒ Promise.<void>

join a set of tasks in parallel

Kind: global function

| Param | Type | Description | | --- | --- | --- | | tasks | Array.<function()> | tasks to join |

runTasks(task) ⇒ Promise.<void>

run a task an report it's time and result

Kind: global function

| Param | Type | Description | | --- | --- | --- | | task | function | task to run and report time and result |

webpack(config) ⇒ Promise.<string>

Run webpack and report the result

Kind: global function

| Param | Type | Description | | --- | --- | --- | | config | Object | the webpack config and report result |

zipDirectory(sourceDir, outPath) ⇒ Promise

zip the contents of a directory into a single file

Kind: global function

| Param | Type | Description | | --- | --- | --- | | sourceDir | String | path to directory to zip | | outPath | String | path to zip file to create |

getFileMatches(dirPath, isMatch, recurse, parents) ⇒ Promise.<Array.<string>>

get files that match a test

Kind: global function

| Param | Type | Description | | --- | --- | --- | | dirPath | string | the path of the directory containing the files | | isMatch | isFileMatch | function to test if a file is a match | | recurse | boolean | whether to recurse into child folders | | parents | Array.<string> | array of parent directories |

getFiles(dirPath, recurse) ⇒ Promise.<Array.<string>>

Get the files in a directory

Kind: global function

| Param | Type | Description | | --- | --- | --- | | dirPath | string | the path of the directory containing the files | | recurse | boolean | whether to recurse into child folders |

getDirs(dirPath, recurse) ⇒ Promise.<Array.<string>>

Get directories in a directory

Kind: global function

| Param | Type | Description | | --- | --- | --- | | dirPath | string | the path of the directory containing the files | | recurse | boolean | whether to recurse into child folders |

getFileWithName(dirPath, name, extensions) ⇒ Promise.<string>

get a source file by name

Kind: global function

| Param | Type | Description | | --- | --- | --- | | dirPath | string | the path of the directory containing the files | | name | string | the name of the source file | | extensions | string | Array.<string> | '*' | the extension of possible extensions of the file |

isFileMatch ⇒ boolean

Matcher for getFileMatches

Kind: global typedef

| Param | Type | Description | | --- | --- | --- | | file | Node.File | file to check for a match | | parents | Array.<string> | parents of the file to check |