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

static-cling

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

static-cling - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

readme.md

9

bin/static.js
#!/usr/bin/env node
console.log('starting static file server');
var path = require('path'),

@@ -7,3 +6,4 @@ argv = require('optimist').argv,

port = 3000,
dir = '.';
dir = '.',
file = 'index.html';

@@ -16,6 +16,9 @@ if(argv.p){

}
if(argv.f){
file = argv.f;
}
path.exists(dir, function (exists) {
if(exists){
console.log('starting to serve files in ' + dir + ' on port ' + port);
cling(port, dir);
cling(port, dir, file);
}else{

@@ -22,0 +25,0 @@ console.log('Directory does not exist');

@@ -7,4 +7,3 @@ var path = require('path'),

var cling = function(port,rootPath){
var cling = function(port,rootPath, defaultFilename){
if(rootPath===undefined){

@@ -16,2 +15,6 @@ rootPath = '.';

}
if(defaultFilename === undefined){
defaultFilename = 'index.html';
}
http.createServer(function (req, res) {

@@ -25,3 +28,3 @@ var uri = url.parse(req.url).pathname;

});
res.write('404 Not Found\n');
res.write('404 - File Not Found\n');
res.end();

@@ -32,3 +35,3 @@ return;

if (fs.statSync(filename).isDirectory()) {
filename += '/index.html';
filename = path.join(filename, defaultFilename);
}

@@ -55,3 +58,3 @@

}).listen(port);
}
};
exports.cling = cling;
{ "name": "static-cling"
, "version": "0.0.3"
, "version": "0.0.4"
, "engines": [ "node >=0.6.0" ]

@@ -4,0 +4,0 @@ , "description": "Static file server"

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