Comparing version 5.1.0 to 5.2.0
@@ -31,1 +31,3 @@ 'use strict'; | ||
}); | ||
gulp.task('default', ['lint', 'test']); |
'use strict'; | ||
module.exports = require('./src/stringify'); |
{ | ||
"name": "stringify", | ||
"description": "Browserify middleware to be able to require() text files (including templates) inside of your client-side JavaScript files.", | ||
"version": "5.1.0", | ||
"version": "5.2.0", | ||
"main": "./index.js", | ||
@@ -14,3 +14,4 @@ "author": "John Postlethwait <john.postlethwait@gmail.com>", | ||
"Michaelangelo Jong <mike96angelo@gmail.com>", | ||
"Matthew Dunsdon <matthewdunsdon@gmail.com>" | ||
"Matthew Dunsdon <matthewdunsdon@gmail.com>", | ||
"Ugo Stephant <ugo@poool.fr>" | ||
], | ||
@@ -37,3 +38,3 @@ "website": "http://johnpostlethwait.github.com/stringify/", | ||
"browserify-transform-tools": "^1.5.3", | ||
"html-minifier": "1.1.1" | ||
"html-minifier": "3.5.2" | ||
}, | ||
@@ -40,0 +41,0 @@ "devDependencies": { |
# Stringify # | ||
_**NOTE:** I no longer actively maintain this package. I'd love to get PRs to keep it going though!_ | ||
[![NPM](https://nodei.co/npm/stringify.png?downloads&downloadRank)](https://nodei.co/npm/stringify/) | ||
[![Build Status][travis-image]][travis-url] | ||
@@ -9,3 +12,3 @@ Browserify plugin to require() text files (such as HTML templates) inside of | ||
*NOTE:* Has not been tested on Node below version 4.0.0, and has been tested up | ||
to Node 5.5.0. Please report (or put a Pull Request up for) any bugs you may | ||
to Node 8.1.3. Please report (or put a Pull Request up for) any bugs you may | ||
find. | ||
@@ -90,3 +93,3 @@ | ||
stringify.registerWithRequire({ | ||
extensions: ['.txt', '.html'], | ||
appliesTo: { includeExtensions: ['.txt', '.html'] }, | ||
minify: true, | ||
@@ -106,2 +109,6 @@ minifyAppliesTo: { | ||
For NodeJS, the __appliesTo__ configuration option only supports the | ||
__includeExtensions__ option - see _Including / Excluding Files_ section for | ||
further details. | ||
## Configuration ## | ||
@@ -307,1 +314,4 @@ | ||
* Place a space after a conditional or function name, and its conditions/arguments. `function (...) {...}` | ||
[travis-url]: https://travis-ci.org/JohnPostlethwait/stringify | ||
[travis-image]: https://img.shields.io/travis/JohnPostlethwait/stringify.svg |
@@ -91,17 +91,7 @@ 'use strict'; | ||
*/ | ||
function getExtensions (options) { | ||
/** | ||
* The file extensions which are stringified by default. | ||
* @type {string[]} | ||
*/ | ||
function getRequireExtensions (options) { | ||
var extensions = TRANSFORM_OPTIONS.includeExtensions; | ||
if (options) { | ||
if (Object.prototype.toString.call(options) === '[object Array]') { | ||
extensions = options; | ||
} else if (options.extensions && options.extensions._) { | ||
extensions = options.extensions._; | ||
} else if(options.extensions) { | ||
extensions = options.extensions; | ||
} | ||
if (options && options.appliesTo && options.appliesTo.includeExtensions) { | ||
extensions = options.appliesTo.includeExtensions; | ||
} | ||
@@ -189,5 +179,5 @@ | ||
function registerWithRequire (options) { | ||
NODE_REQUIRE_OPTIONS = options || {}; | ||
NODE_REQUIRE_OPTIONS = getTransformOptions(options); | ||
var exts = getExtensions(NODE_REQUIRE_OPTIONS); | ||
var exts = getRequireExtensions(NODE_REQUIRE_OPTIONS); | ||
@@ -259,3 +249,3 @@ for (var i = 0; i < exts.length; i++) { | ||
module.exports.stringify = stringify; | ||
module.exports.getExtensions = getExtensions; | ||
module.exports.getRequireExtensions = getRequireExtensions; | ||
module.exports.getTransformOptions = getTransformOptions; | ||
@@ -262,0 +252,0 @@ module.exports.TRANSFORM_OPTIONS = TRANSFORM_OPTIONS; |
This is a mock text file for the test fixtures! |
@@ -0,0 +0,0 @@ /* jshint expr: true */ |
@@ -0,0 +0,0 @@ /* jshint expr: true */ |
@@ -0,0 +0,0 @@ /* jshint expr: true */ |
@@ -0,0 +0,0 @@ /* jshint expr: true */ |
@@ -0,0 +0,0 @@ /* jshint expr: true */ |
@@ -0,0 +0,0 @@ /* jshint expr: true */ |
@@ -0,0 +0,0 @@ /* jshint expr: true */ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
114436
22
2941
314
1
+ Addedcamel-case@3.0.0(transitive)
+ Addedclean-css@4.1.11(transitive)
+ Addedcommander@2.11.02.9.0(transitive)
+ Addedhe@1.1.1(transitive)
+ Addedhtml-minifier@3.5.2(transitive)
+ Addedncname@1.0.0(transitive)
+ Addedno-case@2.3.2(transitive)
+ Addedparam-case@2.1.1(transitive)
+ Addeduglify-js@3.0.28(transitive)
+ Addedxml-char-classes@1.0.0(transitive)
- Removedalign-text@0.1.4(transitive)
- Removedamdefine@1.0.1(transitive)
- Removedasync@0.2.10(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedcamel-case@1.2.2(transitive)
- Removedcamelcase@1.2.1(transitive)
- Removedcenter-align@0.1.3(transitive)
- Removedchange-case@2.3.1(transitive)
- Removedclean-css@3.4.28(transitive)
- Removedcli@0.11.3(transitive)
- Removedcliui@2.1.0(transitive)
- Removedcommander@2.8.1(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedconcat-stream@1.5.2(transitive)
- Removedconstant-case@1.1.2(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removeddecamelize@1.2.0(transitive)
- Removeddot-case@1.1.2(transitive)
- Removedexit@0.1.2(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedglob@7.2.3(transitive)
- Removedhtml-minifier@1.1.1(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinherits@2.0.4(transitive)
- Removedis-buffer@1.1.6(transitive)
- Removedis-lower-case@1.1.3(transitive)
- Removedis-upper-case@1.1.2(transitive)
- Removedisarray@1.0.0(transitive)
- Removedkind-of@3.2.2(transitive)
- Removedlazy-cache@1.0.4(transitive)
- Removedlongest@1.0.1(transitive)
- Removedlower-case-first@1.0.2(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedonce@1.4.0(transitive)
- Removedparam-case@1.1.2(transitive)
- Removedpascal-case@1.1.2(transitive)
- Removedpath-case@1.1.2(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedprocess-nextick-args@1.0.7(transitive)
- Removedreadable-stream@2.0.6(transitive)
- Removedrepeat-string@1.6.1(transitive)
- Removedright-align@0.1.3(transitive)
- Removedsentence-case@1.1.3(transitive)
- Removedsnake-case@1.1.2(transitive)
- Removedsource-map@0.4.4(transitive)
- Removedstring_decoder@0.10.31(transitive)
- Removedswap-case@1.1.2(transitive)
- Removedtitle-case@1.1.2(transitive)
- Removedtypedarray@0.0.7(transitive)
- Removeduglify-js@2.6.4(transitive)
- Removeduglify-to-browserify@1.0.2(transitive)
- Removedupper-case-first@1.1.2(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedwindow-size@0.1.0(transitive)
- Removedwordwrap@0.0.2(transitive)
- Removedwrappy@1.0.2(transitive)
- Removedyargs@3.10.0(transitive)
Updatedhtml-minifier@3.5.2