grunt-inline-css
Advanced tools
+16
| language: node_js | ||
| before_script: | ||
| - npm install -g grunt-cli@latest | ||
| script: | ||
| - npm run travis | ||
| node_js: | ||
| - "0.10" | ||
| - "0.12" | ||
| - "4" | ||
| - "6" | ||
| - "7" | ||
| - "node" | ||
| sudo: false |
| <!doctype html> | ||
| <html> | ||
| <head> | ||
| </head> | ||
| <body style="font-family: Test, 'Segoe UI', Arial; background: green;"> | ||
| <h1 style="border: 1px solid #ccc; color: blue; font-family: Arial !important;">Hi</h1> | ||
| <table> | ||
| <tr> | ||
| <td class="headline" style="padding: 5px; font-size: 24px;">Some Headline</td> | ||
| </tr> | ||
| </table> | ||
| </body> | ||
| </html> |
+19
-1
@@ -35,3 +35,3 @@ /* | ||
| options: { | ||
| extraCss: 'body { background: green; }' | ||
| extraCss: 'body { background: green; }', | ||
| }, | ||
@@ -42,2 +42,20 @@ files: { | ||
| }, | ||
| with_important: { | ||
| options: { | ||
| extraCss: 'body { background: green; }', | ||
| preserveImportant: true | ||
| }, | ||
| files: [ | ||
| { | ||
| src: 'test/fixtures/in.html', | ||
| dest: 'tmp/out_with_important.html' | ||
| } | ||
| ], | ||
| }, | ||
| does_not_exist: { | ||
| options: {}, | ||
| files: { | ||
| 'tmp/out_does_not_exist.html': 'test/fixtures/in_does_not_exist.html' | ||
| }, | ||
| } | ||
| }, | ||
@@ -44,0 +62,0 @@ |
+15
-9
| { | ||
| "name": "grunt-inline-css", | ||
| "description": "Takes an html file with css link and turns inline. Great for emails.", | ||
| "version": "0.1.5", | ||
| "version": "1.0.0", | ||
| "homepage": "https://github.com/jgallen23/grunt-inline-css", | ||
@@ -9,2 +9,7 @@ "author": { | ||
| }, | ||
| "contributors": [ | ||
| { | ||
| "name": "Simon Bruce" | ||
| } | ||
| ], | ||
| "repository": { | ||
@@ -25,15 +30,16 @@ "type": "git", | ||
| "engines": { | ||
| "node": ">= 0.8.0" | ||
| "node": ">= 0.10.0" | ||
| }, | ||
| "scripts": { | ||
| "test": "grunt test" | ||
| "test": "grunt test", | ||
| "travis": "grunt test" | ||
| }, | ||
| "devDependencies": { | ||
| "grunt-contrib-jshint": "~0.7.1", | ||
| "grunt-contrib-clean": "~0.5.0", | ||
| "grunt-contrib-nodeunit": "~0.2.2", | ||
| "grunt": "~0.4.0" | ||
| "grunt-contrib-jshint": "~1.1.0", | ||
| "grunt-contrib-clean": "~1.0.0", | ||
| "grunt-contrib-nodeunit": "~1.0.0", | ||
| "grunt": "~1.0.1" | ||
| }, | ||
| "peerDependencies": { | ||
| "grunt": "~0.4.0" | ||
| "grunt": ">=0.4.0" | ||
| }, | ||
@@ -44,4 +50,4 @@ "keywords": [ | ||
| "dependencies": { | ||
| "juice": "~1.2.0" | ||
| "juice": "~3.0.1" | ||
| } | ||
| } |
+5
-2
@@ -6,4 +6,5 @@ # grunt-inline-css | ||
| ## Getting Started | ||
| This plugin requires Grunt `~0.4.0` | ||
| This plugin requires Grunt `>=0.4.0` | ||
| If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command: | ||
@@ -24,2 +25,3 @@ | ||
| ### Overview | ||
| In your project's Gruntfile, add a section named `inlinecss` to the data object passed into `grunt.initConfig()`. | ||
@@ -41,5 +43,6 @@ | ||
| You can see available options [here](https://github.com/LearnBoost/juice#juicefilepath-options-callback) | ||
| You can see available options [here](https://github.com/Automattic/juice/tree/v3.0.1#options) | ||
| ## Contributing | ||
| In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/). |
+16
-7
@@ -25,2 +25,9 @@ /* | ||
| var increaseCount = function () { | ||
| index++; | ||
| if (index === count) { | ||
| done(); | ||
| } | ||
| }; | ||
| // Iterate over all specified file groups. | ||
@@ -32,2 +39,3 @@ this.files.forEach(function(f) { | ||
| grunt.log.error('src must be a single string'); | ||
| increaseCount(); | ||
| return false; | ||
@@ -38,9 +46,15 @@ } | ||
| grunt.log.error('Source file "' + filepath + '" not found.'); | ||
| increaseCount(); | ||
| return false; | ||
| } | ||
| grunt.log.writeln("filepath:", filepath); | ||
| juice.juiceFile(filepath, options, function(err, html) { | ||
| if (err) { | ||
| return grunt.log.error(err); | ||
| grunt.log.error(err); | ||
| increaseCount(); | ||
| return; | ||
| } | ||
@@ -51,8 +65,3 @@ | ||
| index++; | ||
| if (index === count) { | ||
| done(); | ||
| } | ||
| increaseCount(); | ||
| }); | ||
@@ -59,0 +68,0 @@ |
@@ -8,3 +8,3 @@ <!doctype html> | ||
| <body style="font-family: Test, 'Segoe UI', Arial; background: green;"> | ||
| <h1 style="border: 1px solid #ccc; color: blue;">Hi</h1> | ||
| <h1 style="border: 1px solid #ccc; color: blue; font-family: Arial;">Hi</h1> | ||
| <table> | ||
@@ -11,0 +11,0 @@ <tr> |
@@ -6,2 +6,3 @@ body { | ||
| color: blue; | ||
| font-family: Arial !important; | ||
| } | ||
@@ -8,0 +9,0 @@ .headline { |
@@ -39,3 +39,30 @@ 'use strict'; | ||
| test.done(); | ||
| }, | ||
| with_important: function(test) { | ||
| test.expect(1); | ||
| var actual = grunt.file.read('tmp/out_with_important.html'); | ||
| var expected = grunt.file.read('test/expected/out_with_important.html'); | ||
| test.equal(actual, expected, 'should inline css'); | ||
| test.done(); | ||
| }, | ||
| does_not_exist: function(test) { | ||
| test.expect(0); | ||
| try { | ||
| var actual = grunt.file.read('tmp/out_does_not_exist.html'); | ||
| } catch(err) { | ||
| if (err.origError.code === 'ENOENT') { | ||
| return test.done(); | ||
| } | ||
| return test.done(new Error('Should have errored with a file not found: ' + err.code)); | ||
| } | ||
| test.done(new Error('Should have errored')); | ||
| } | ||
| }; |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
11635
20.83%17
13.33%199
30.07%0
-100%46
6.98%1
Infinity%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated