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 2.0.0 to 2.0.1

4

lib/index.js

@@ -11,3 +11,3 @@ const handler = require('./handler')

const config = { ...defaults, ...options }
console.log('config', options)
const serverHandler = handler(config)

@@ -17,3 +17,3 @@

s.listen(config.port)
console.log('server')
console.info('Server Started')
}
const http = require('http')
module.exports = handler => {
return http.createServer(handler)
}
}
{
"name": "static-cling",
"version": "2.0.0",
"version": "2.0.1",
"engines": [

@@ -16,3 +16,3 @@ "node >=8.0.0"

},
"homepage": "http://kevinisom.info/static-cling",
"homepage": "http://kevinisom.info/Static-Cling/",
"scripts": {

@@ -53,2 +53,2 @@ "test": "mocha ./test/super.test.js",

}
}
}

@@ -1,24 +0,33 @@

#Static Cling
# Static Cling
This is a node.js module that allows you to spin up a static file server either from code or from the command line.
###Installing
$ npm install static-cling
### Installing
```bash
npm install static-cling
```
Don't forget to use the global flag (--g) if you want the command line option everywhere.
###At the command line
$ static
### At the command line
```bash
static
```
Yeah, that's it. You have the option to pass in -p for port, otherwise it defaults to port 3000, -d for directory, if you want to specify a different directory than the one you are in, and lastly -f for the default html page, this defaults to index.html
###In Code
### In Code
Static Cling is available to be used as a module as well if you want to use node to host static files.
```js
require('static-cling')();
```
require('static-cling').cling();
```
### Options
If using the module you can override the defaults by providing a config object
```
```js
//defaults

@@ -30,4 +39,5 @@ var config = {

}
const cling = require('static-cling')
//overriding defaults
cling({ port: 3456, root : './other/', filename: 'test.html' });
```
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