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 🙏

© 2024 – Pkg Stats / Ryan Hefner

generate-hash-files

v1.1.3

Published

Generate hash files

Downloads

3

Readme

Generate hash files

Import

npm install generate-hash-files

or

yarn add generate-hash-files

Config

Create file generate-hash-files.json (if not exist)

Sample:

{
    "files": [
        {
            "id": "Your name",
            "input": "./build/",
            "output": "./dist/",
            "indexFile": "index.json"
        }
    ]
}

files

Set of release.

files.id

Id of config.

files.input

Path of folder that contains files to hash

files.output

Path of output folder that contains copied files. If omitted, no file is copied.

files.indexFile

Index json file path. If ommited, index file is index.json

files.extensions

List of supported file extensions.

Sample:

{
    "extensions": [ ".html", ".js", ".css" ]
}

if extensions was omitted, the default extension list will be used: ".html", ".htm", ".css", ".js", ".json", ".png", ".jpg", ".jpeg", ".gif", ".svg", ".ico", ".webp", ".ttf", ".woff", ".woff2", ".eot", ".mp3", ".mp4", ".avi"

files.exclude

List of exclusion patterns

Sample:

{
    "exclude": [ "data.log", "result_\\d+\\.txt" ]
}

files.inject

Set of injection rules. inject will be ignored if output is omitted or same to input

Sample

{
    "inject": {
        "Replacement token here. Sample: #GIT_GIT_HASH#": {
            "files": [ "./index.html" ],
            "value": "Your value. You need to encode yourself",
            "env": "Environment name. Ex: NODE_ENV",
            "command": "Shell here. Ex: git rev-parse --verify HEAD"
        }
    }
}

Priority order: value then env then command. Lower priority field will be ignored if higher priority exists.

files.inject.files

List of files that will be replaced by value.

files.inject.value

Value to replace

files.inject.env

Environment name that its value will be used to replace (if files.inject.value ommited)

files.inject.command

Shell command will be exectuted and its output will be used to replace (if files.inject.value and files.inject.env ommited)

files.inject.transform

Transform function. One of: stringify, trim, encodeHTML, encodeURIComponent.

silent

Config console output. If silent is true, no message will be outputed.

Sample:

{
    "files": [...],
    "silent": true
}

Usage

npx generate-hash-files