Comparing version 0.1.1 to 1.0.0
17
index.js
module.exports = function (extra_extensions) { | ||
var oneliner = require('oneliner'); | ||
@@ -23,6 +22,18 @@ var extensions = [ | ||
var middleware = function (bundle) { | ||
function stringifyText(text) { | ||
var stringified_text; | ||
stringified_text = text.replace(/\"/g, '\u005C\u0022'); | ||
stringified_text = stringified_text.replace(/^(.*)/gm, '"$1'); | ||
stringified_text = stringified_text.replace(/(.+)$/gm, '$1" +'); | ||
stringified_text = stringified_text.replace(/\+$/, ''); | ||
return stringified_text; | ||
} | ||
var text_handler = function (body, file) { | ||
var safe_body = oneliner(body).replace(/\"/g, '\u005C\u0022'); | ||
var safe_body = stringifyText(body); | ||
return 'module.exports = "' + safe_body + '";\n'; | ||
return 'module.exports = ' + safe_body + ';\n'; | ||
}; | ||
@@ -29,0 +40,0 @@ |
{ | ||
"name": "stringify", | ||
"description": "Browserify middleware to be able to require() text files (including templates) inside of your client-side JavaScript files.", | ||
"version": "0.1.1", | ||
"version": "1.0.0", | ||
"main": "./index.js", | ||
"author": "John Postlethwait <john.postlethwait@gmail.com>", | ||
"website": "http://johnpostlethwait.github.com/stringify/", | ||
@@ -10,13 +11,14 @@ "keywords": [ | ||
"require", | ||
"template" | ||
"template", | ||
"text", | ||
"txt", | ||
"client-side" | ||
], | ||
"repositories": [ | ||
{ | ||
"type": "git", | ||
"url": "git://github.com/JohnPostlethwait/stringify.git" | ||
} | ||
], | ||
"dependencies": { | ||
"oneliner": "0.0.8" | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/JohnPostlethwait/stringify.git" | ||
}, | ||
"engines" : { | ||
"node" : "*" | ||
}, | ||
"licenses": [ | ||
@@ -23,0 +25,0 @@ { |
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
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
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the 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
4162
0
33
2
1
0
- Removedoneliner@0.0.8
- Removedoneliner@0.0.8(transitive)