Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hash-resources

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hash-resources

Creates hashed version of resources for cache invalidation purposes

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

hash-resources

Creates hashed version of resources for cache invalidation purposes

Turns

<link rel="stylesheet" href="css/styles.css">
<script src="js/main.js"></script>

into

<link rel="stylesheet" href="css/styles-c9a7c7ed62.css">
<script src="js/main-d1a111ea32.js"></script>

Hash is MD5 of the content.

Usage

npm install hash-resources

Default settings (link and script tags with -hash appended to file name)

hash-resources example/index.html > example/index.after.html

Explicit config matching default settings

hash-resources --selector=link@href --selector=script@src --name="{path}-{hash}{extension}" example/index.html > example/index.after.html

Path, hash and extension are variables from which you can construct a file name. Extension already contains a dot (.)

Hash in query param

hash-resources --query=v example/index.html > example/index.after.html

FAQs

Package last updated on 16 Feb 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc