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

@untool/express

Package Overview
Dependencies
Maintainers
3
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@untool/express - npm Package Compare versions

Comparing version 0.5.0 to 0.6.0

index.js

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

<a name="0.6.0"></a>
# [0.6.0](https://github.com/untool/untool/compare/v0.5.1...v0.6.0) (2018-05-16)
### Features
* **express:** add untool/express main export ([3e00bac](https://github.com/untool/untool/commit/3e00bac))
<a name="0.5.0"></a>

@@ -8,0 +19,0 @@ # [0.5.0](https://github.com/untool/untool/compare/v0.4.3...v0.5.0) (2018-05-07)

34

mixin.core.js

@@ -11,33 +11,17 @@ const {

class ExpressMixin extends Mixin {
create(method) {
const create = require(method === 'static'
? './lib/static'
: './lib/serve');
createServer(mode) {
const isStatic = mode === 'static';
const create = isStatic ? require('./lib/static') : require('./lib/serve');
const { options, config, initializeServer, finalizeServer } = this;
return create(method, options, config, initializeServer, finalizeServer);
return create(mode, options, config, initializeServer, finalizeServer);
}
run(method) {
runServer(mode) {
const run = require('./lib/run');
const app = this.createServer(mode);
const { config, inspectServer, logInfo, logError } = this;
const app = this.create(method);
return run(app, config, inspectServer, logInfo, logError);
}
runServer() {
return this.run('serve');
}
runDevServer() {
return this.run('develop');
}
createServer() {
return this.create('serve');
}
createDevServer() {
return this.create('develop');
}
createRenderer() {
return this.create('static');
}
renderLocations() {
const indexFile = require('directory-index');
const render = this.createRenderer();
const render = this.createServer('static');
const { basePath, locations } = this.config;

@@ -89,3 +73,3 @@ const { resolveAbsolute, resolveRelative } = uri;

},
handler: () => this.runServer(),
handler: () => this.runServer('serve'),
});

@@ -102,4 +86,4 @@ }

inspectServer: sequence,
createServer: overrideSync,
runServer: overrideSync,
runDevServer: overrideSync,
renderLocations: overrideAsync,

@@ -106,0 +90,0 @@ };

{
"name": "@untool/express",
"version": "0.5.0",
"version": "0.6.0",
"description": "untool express mixin",

@@ -27,3 +27,3 @@ "keywords": [

"@untool/core": "^0.5.0",
"@untool/yargs": "^0.5.0",
"@untool/yargs": "^0.6.0",
"compression": "^1.7.2",

@@ -30,0 +30,0 @@ "directory-index": "^0.1.0",

@@ -19,3 +19,3 @@ # `@untool/express`

`@untool/express` registers a single command using [`@untool/yargs`](https://github.com/untool/untool/blob/master/packages/yargs/README.md#registercommandsyargs-chalk-pipe): `serve`. As to be expected, this command launches a stand-alone Express server featuring [Helmet](https://helmetjs.github.io) and a [Express' static](https://expressjs.com/en/4x/api.html#express.static) file server middlewares.
`@untool/express` registers a single command using [`@untool/yargs`](https://github.com/untool/untool/blob/master/packages/yargs/README.md#registercommandsyargs-pipe): `serve`. As to be expected, this command launches a stand-alone Express server featuring [Helmet](https://helmetjs.github.io) and a [Express' static](https://expressjs.com/en/4x/api.html#express.static) file server middlewares.

@@ -78,9 +78,9 @@ ```bash

### `runServer(options)` ([override](https://github.com/untool/mixinable/blob/master/README.md#defineoverride))
### `createServer(mode)` ([override](https://github.com/untool/mixinable/blob/master/README.md#defineoverride))
If you want to programmatically start a production ready Express server set up using `@untool/express`' [config](https://github.com/untool/untool/blob/master/packages/express/README.md#settings), you can use this utility mixin method that accepts the same options as the CLI [`serve`](https://github.com/untool/untool/blob/master/packages/express/README.md#arguments) method.
To create an Express app to use in your own server, you can use this utility mixin method. It uses `@untool/express`' [settings](https://github.com/untool/untool/blob/master/packages/express/README.md#settings) for its configuration. It accepts a string: `serve`, `develop` or `static`.
### `runDevServer(options)` ([override](https://github.com/untool/mixinable/blob/master/README.md#defineoverride))
### `runServer(mode)` ([override](https://github.com/untool/mixinable/blob/master/README.md#defineoverride))
To start a development mode Express server programmatically, you can use this utility mixin method. It uses a [`static`](https://github.com/untool/untool/blob/master/packages/express/README.md#-s----static) option and `@untool/express`' [settings](https://github.com/untool/untool/blob/master/packages/express/README.md#settings) for its configuration.
If you want to programmatically start a production ready Express server set up using `@untool/express`' [config](https://github.com/untool/untool/blob/master/packages/express/README.md#settings), you can use this utility mixin method. It accepts a string: `serve` or `develop`.

@@ -108,3 +108,3 @@ ### `renderLocations()` ([override](https://github.com/untool/mixinable/blob/master/README.md#defineoverride))

`@untool/express` fully supports HTTPS and using this key, you can configure its SSL/TLS mode. You can either set it to `true` to enable SSL with the included insecure certificate. Or your can tell it to use a [proper](https://letsencrypt.org) SSL certificate.
`@untool/express` fully supports HTTPS and using this key, you can configure its SSL/TLS mode. You can either set it to `true` to enable SSL with the included insecure certificate. Or you can tell it to use a [proper](https://letsencrypt.org) SSL certificate.

@@ -111,0 +111,0 @@ ```json

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