# gulp-crisper

> Gulp plugin for crisper that split inline scripts from an HTML file for CSP compliance

Latest version **1.1.0** (published 2016-05-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install gulp-crisper
pnpm add gulp-crisper
yarn add gulp-crisper
bun add gulp-crisper
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2016-05-26 |
| First published | 2015-04-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 18 |
| Author | ragingwind |
| Maintainers | ragingwind |
| Keywords | gulpplugin, polymer, vulcanize, vulcan, csp, cspify, web, components |

## Links

- npm: https://www.npmjs.com/package/gulp-crisper
- Repository: https://github.com/ragingwind/gulp-crisper
- Homepage: https://github.com/ragingwind/gulp-crisper#readme
- Issues: https://github.com/ragingwind/gulp-crisper/issues
- npm.io page: https://npm.io/package/gulp-crisper

## Dependencies (4)

- [crisper](https://npm.io/package/crisper.md) ^2.0.0
- [through2](https://npm.io/package/through2.md) ^2.0.0
- [gulp-util](https://npm.io/package/gulp-util.md) ^3.0.7
- [object-assign](https://npm.io/package/object-assign.md) ^4.0.1

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2016-05-26
- 1.0.0 — 2015-11-05
- 0.0.7 — 2015-10-23
- 0.0.6 — 2015-10-16
- 0.0.5 — 2015-07-29
- 0.0.4 — 2015-04-20
- 0.0.2 — 2015-04-20
- 0.0.1 — 2015-04-17

## README

# gulp-crisper

> Gulp plugin for [Crisper](https://github.com/PolymerLabs/crisper) that split inline scripts from an HTML file for CSP compliance

*Issues with the output should be reported on the `Crisper` [issue tracker](https://github.com/PolymerLabs/crisper/issues).*


## Install

```
$ npm install --save-dev gulp-crisper
```


## Usage

```js
var gulp = require('gulp');
var vulcanize = require('gulp-vulcanize');
var crisper = require('gulp-crisper');

gulp.task('default', function () {
	return gulp.src('src/index.html')
		.pipe(vulcanize({
			abspath: '',
			excludes: [],
			stripExcludes: false,
			inlineScripts: false
		}))
		.pipe(crisper({
			scriptInHead: false, // true is default
			onlySplit: false
		}))
		.pipe(gulp.dest('dest'));
});
```

## FAQ

### Using `jsFileName` option

If you would like to use `jsFileName` and need to change the path of js file comes out from `crisper`? You should use `gulp-rename` for it because `jsFileName` option only affect on the path in `script` tag in vulcanized html. Here is one of samples to show how to use `gulp-rename` with it.

```
return gulp.src('public/elements/elements.vulcanized.html')
  .pipe(crisper({
    jsFileName: 'elements.crisper.js'
  }))
  .pipe(rename(function(file) {
      if (file.extname === '.js') {
        file.basename = ''elements.crisper.js';
      }
    }))
  })
  .pipe(gulp.dest('dest/elements'))
```

### Options

You can use options of crisper. see [doc](https://github.com/PolymerLabs/crisper#usage) for further information.

## License

MIT © [Jimmy Moon](http://ragingwind.me)

---
_Source: https://npm.io/package/gulp-crisper · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
