Socket
Book a DemoInstallSign in
Socket

cachebusted

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

cachebusted

Map artifact names to cachebusted names

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Standard Readme

Contributor Covenant Uses editorconfig JS written in Standard style Licensed under MIT

Map artifact names to cachebusted names

A manifest file is a JSON file that maps the name of an artifact to the path you can actually find it at. This is an important feature when you use cachebusting. This library helps you read and write these files.

Table of Contents

Install

This project uses node and npm. Go check them out if you don't have them locally installed.

$ npm install cachebusted

Usage

Initialize a new manifest file like this (the file doesn't need to exist yet):

let manifest = new Manifest({
  path: '/path/to/a/manifest.json'
})

You can read from the file like this:

manifest.translate('index.js').then((val) => {
  // val is now the cachebusted version of index.js
  console.log(val)
}).catch((err) => {
  // Don't forget to handle errors
})

You can now add entries to the file like this:

writeManifest.add({ 'frontend.js': 'frontend-123.js' }).then(() => {
  // Do what you need to do next
}).catch((err) => {
  // Don't forget to handle errors
})

Contribute

Bug reports and pull requests are welcome on GitHub at https://github.com/moonglum/cachebusted. You can find more information about contributing in the CONTRIBUTING.md. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The package is available as open source under the terms of the MIT License.

FAQs

Package last updated on 13 Nov 2016

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.