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

crisper

Package Overview
Dependencies
Maintainers
3
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crisper

Make an HTML file with inline scripts CSP compliant

  • 1.0.7
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

Crisper

Split inline scripts from an HTML file for CSP compliance

Usage

Command line usage:

cat index.html | crisper -h build.html -j build.js
crisper --source index.html --html build.html --js build.js

Library usage:

var output = crisper(htmlString, jsOutputFileName);
fs.writeFile(htmlOutputFileName, output.html, 'utf-8', ...);
fs.writeFile(jsOutputFileName, output.js, 'utf-8', ...);

Usage with Vulcanize

When using vulcanize, crisper can handle the html string output directly and write the CSP seperated files on the command line

vulcanize index.html --inline-script | crisper --html build.html --js
build.js

Or programmatically

vulcanize.process('index.html', function(err, html) {
  if (err) {
    return cb(err);
  } else {
    var out = crisper.split(html, jsFilename)
    cb(null, out.html, out.js);
  }
});

Build Tools

  • gulp-crisper
  • No grunt plugin yet, will you write it?
  • No broccoli plugin yet, will you write it?

FAQs

Package last updated on 06 Aug 2015

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