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

js-loader

Package Overview
Dependencies
Maintainers
0
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

js-loader - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

lib/.responseCache.js.swp

6

package.json
{ "name": "js-loader"
, "description": "On-the-fly javascript contacatenator, minifier and dependency resolver for client-side JS"
, "version": "0.1.0"
, "version": "0.1.1"
, "homepage": "https://github.com/dmcquay/node-js-loader"
, "repository": "git://github.com/dmcquay/node-js-loader.git"
, "author": "Dustin McQuay <dmcquay@gmail.com> (http://www.synchrosinteractive.com/)"
, "main": "jsloader"
, "main": "lib/main"
, "directories": { "lib": "" }
, "scripts": { "test": "vows test/jsloader.js" }
, "scripts": { "test": "vows test/*.js" }
, "bin": { "jsloader": "./bin/jsloader" }

@@ -11,0 +11,0 @@ , "dependencies" :

@@ -79,6 +79,6 @@ #Node JS Loader (client-side)

#Planned features
#Tech Details about the bundled server
* Caching
* GZip (maybe use Connect?)
* Conditional Get support (maybe use Connect?)
* Supports Conditional Gets.
* Supports GZip compression.
* Requests are cached. Cache is expired as needed when underlying files are modified.

@@ -6,3 +6,3 @@ var vows = require('vows'),

temp = require('temp'),
JSLoader = require('.././jsloader.js').JSLoader,
JSLoader = require('../lib/jsloader.js').JSLoader,
testSrc = './test/test-src',

@@ -13,3 +13,3 @@ testSrcDirs = [testSrc + '/test-src-1', testSrc + '/test-src-2'];

'when we create a new JSLoader': {
topic: function() { return new JSLoader([testSrcDirs[0]]) },
topic: function() { return new JSLoader(testSrcDirs.concat(['/test/with/extra/slash/'])) },

@@ -26,2 +26,7 @@ 'we get an instance of JSLoader': function(topic) {

assert.ok(topic.srcDirs instanceof Array);
},
'extra slash is removed from last srcDir': function(topic) {
var dir = topic.srcDirs[topic.srcDirs.length-1];
assert.equal(dir, '/test/with/extra/slash');
}

@@ -36,5 +41,5 @@ },

'is an empty string': function(topic) {
assert.equal(typeof(topic), 'string');
assert.equal(topic.length, 0);
'is an error': function(err, topic) {
assert.ok(err && err.length > 0);
assert.isUndefined(topic);
}

@@ -118,24 +123,3 @@ },

}
},
'a cached result is expired when a contained file is chagned': {
topic: function() {
var self = this;
temp.mkdir('jsloader-test', function(err, dirPath) {
var fileName = path.join(dirPath, "a.js");
var loader = new JSLoader([dirPath]);
fs.writeFileSync(fileName, "a");
loader.getContent(['a.js'], function(err, content) {
fs.writeFileSync(fileName, "b");
loader.getContent(['a.js'], function(err, content) {
self.callback(null, content);
});
});
});
},
'contains the updated contents of the file': function(topic) {
assert.equal(topic, "b\n");
}
}
}).export(module);

Sorry, the diff of this file is not supported yet

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