šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

postcss-hash

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-hash

PostCSS plugin to replace output file names with HASH algorithms (md5, sha256, sha512, etc) and string length of your choice - for cache busting

0.1.0
Source
npm
Version published
Weekly downloads
4.4K
-6.93%
Maintainers
1
Weekly downloads
Ā 
Created
Source

PostCSS Hash Build Status

PostCSS plugin to replace output file names with HASH algorithms (md5, sha256, sha512, etc) and string length of your choice - for cache busting.

# input
postcss input.css -o output.css

# output
output.a1b2c3d4e5.css
# input
postcss css/in/*.css --dir css/out/

# output
file1.a516675ef8.css
file2.aa36634cc4.css
file3.653f682ad9.css
file4.248a1e8f9e.css
file5.07534806bd.css

Usage

// postcss.config.js
module.exports = (ctx) => ({
    plugins: {
        'postcss-hash': {
            algorithm: 'sha256',
            trim: 20
        },
    }
});

Options

algorithm (string, default: 'md5')

Uses node's inbuilt crypto module. Pass any digest algorithm that is supported in your environment. Possible values are: md5, md4, md2, sha, sha1, sha224, sha256, sha384, sha512.

trim (number, default: 10)

Trim the hash length as you needed.

See PostCSS docs for examples for your environment.

Version: 1.0.0
Updated on: August 26, 2017

Keywords

postcss

FAQs

Package last updated on 26 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts