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

gulp-hash-path

v1.1.0

Published

convert path to hash

Readme

gulp-hash-path Build Status

This forked from grunt-md5filename

Convert file paths to hash and keep directory structures.

ex.) path/to/001/octocat.png -> path/to/ad660f5907300f79149bc3dbd9911bd6.png

Installation

npm install --save-dev gulp-hash-path

Usage

var hash = require('gulp-hash-path');

gulp.task('scripts', function() {
    return gulp.src('./img/*.png')
    .pipe(hash())
    .pipe(gulp.dest('./dist/'));
});

API

hashPath([options])

algorithm

Type: String

Default: sha1

hash algorithm.

pathType

Type: String

Default: filename

select hash target for file name or file name with path.

  • filename
    • file name
    • ex)
octcat.png
->  md5('octcat.png')
c29b1fd35e7e51210f3264d567650ac7
  • filepath
    • file name with path
    • ex)
img/github/octocat.png
->  md5('img/github/octocat.png')
ea8bfe94d1b4278fcd9dca963dde3e00

If you want to use keepDirectoryLevel, you set pathType to filepath.

keepBasename

Type: Boolean

Default: false

converted file name add to filename(exclude extension).

octcat.png
-> 'octcat' + '-' + md5(octcat.png)
octcat-c29b1fd35e7e51210f3264d567650ac7

keepExtension

Type: Boolean

Default: false

converted file name add to extension.

octcat.png
-> md5(octcat.png) + '.png'
c29b1fd35e7e51210f3264d567650ac7.png

keepDirectoryLevel

Type: Number

Default: 0

Level of added directory structure.

# keepDirectoryLevel = 1
img/github/octocat.png
->  'img/' + md5('img/github/octocat.png')
img/ea8bfe94d1b4278fcd9dca963dde3e00

# keepDirectoryLevel = 2
img/github/octocat.png
->  'img/github/' + md5('img/github/octocat.png')
img/github/ea8bfe94d1b4278fcd9dca963dde3e00

# keepDirectoryLevel = 3
img/github/octocat.png
->  'img/github/' + md5('img/github/octocat.png')
img/github/ea8bfe94d1b4278fcd9dca963dde3e00

saltPrefix

Type: String

Default: ``

prefix salt

octcat.png
-> md5('__PREFIX__octcat.png')
4dd44b339b8ee57d21894ac57c8ca571

saltSuffix

Type: String Default: ``

suffix salt

octcat.png
-> md5('octcat.png__SUFFIX__')
d43bc35325462bf21a3c7fba0902ed86

ignorePatterns

Type: Array Default: []

ignore file pattern

octcat.png
-> ignorePatterns: ['*.png'],
octcat.png

hashLength

Type: Number

Default: null (32)

split the character length of a hash digest hex value to shorten string. hash is 32 characters in length default.

octcat.png
->  md5('octcat.png'), hashLength = 8
c29b1fd3

hashPath.manifest(path)

path

Type: String

set the manifest file path.