New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rollup-plugin-sri

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-sri

Add subresource integrity tags to all your html files 🔒

  • 1.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
835
increased by22.08%
Maintainers
1
Weekly downloads
 
Created
Source

rollup-plugin-sri

Because web security should not be difficult. This plugin adds subresource integrity attributes to all resources imported by your html files.

Installation

Use the Yarn package manager to install the plugin

yarn add -D rollup-plugin-sri

or npm

npm install --save-dev rollup-plugin-sri

Usage

import sri from 'rollup-plugin-sri'
export default {
  input: 'index.js',
  outupt: {
    file: 'out.js',
    format: 'es'
  },
  plugins: [sri()]
}

Example

You might use a script tag to include a javascript file like this:

<script src="mymmodule.js"></script>

Which then gets turned into this:

<script
  src="mymodule.js"
  integrity="sha256-CF972E3D7A5D3AAD1599AE78F076652067AA30A7AC719F55A37A8DCD9F7901B1"
  crossorigin="anonymous"
></script>

Contributing

I generally dont't think one has to change much, but if you're unhappy with something open an issue, or create a pull request, it's greatly appreciated!

License

MIT

Keywords

FAQs

Package last updated on 29 Jun 2020

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