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

t3h-fs-helper

v1.1.0

Published

My personal promise based fs helper library.

Readme

t3h-fs-helper

This is my personal ES6 promise based fs helper library.

It is designed to build upon common fs functions using promises.

This library only contains the functions that I have needed so far, so there is a lot missing for general use.

Feel free to fork or add to this.

Usage

npm install t3h-fs-helper

const t3hfs = require("t3h-fs-helper");
t3hfs.write("./", "hello.txt", "hello");

API

Comments

The signature for writeMany() might seem a bit odd at first. The idea behind it is that your code will probably already have an object storing filename, directory and data, this allows you to reuse that.

The JsDoc

/**
 * Checks if a dir and its parent dirs exists and creates them if they don't exist.
 * @param {string} dirPath - The path of the dir.
 * @returns {Promise} - And fs error (from fs.stat or fs.mkdir) or void on success.
 */
function ensureDirCreated(dirPath) {...}

/**
 * Reads all the files in specified dir that match the filter. Not recursive.
 * @param {string} dirPath - Read files in this dir.
 * @param {function(string):boolean=} filterFunc - Returns true on file-names that should be included. Default
 * always true.
 * @param {string=} encoding - Defaults to 'utf-8'.
 * @returns {Promise} - An array of objects with string properties {name, path, dir, data}.
 */
function readFilesInDir(dirPath, filterFunc, encoding) {...}

/**
 * Writes data from each item.
 * @param {[]} items - Objects to write a file for each.
 * @param {function({}):[]} func - Function that returns the [dir, fileName, data] for each item.
 * @return {Promise} - void.
 */
function writeMany(items, func) {...}

/**
 * Writes a single file, promise wrapper for fs.writeFile.
 * @param {string} dir - Dir to write the file to.
 * @param {string} fileName - The filename to write.
 * @param {string} data - The data to write.
 * @return {Promise} - void.
 */
function write(dir, fileName, data) {...}

/**
 * Read a utf-8 file in a promise.
 * @param {string} filePath - The path of the file to read.
 * @return {Promise}<string>
 */
function read(filePath) {...}

License

ISC