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

stringify

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stringify - npm Package Compare versions

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 @@

22

package.json
{
"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 @@ {

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