Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
express-composer
Advanced tools
A composition library to help organize your express routes and handlers
A composition library built by extending express
Module | Description |
---|---|
app | Extension module for an express app
|
express-composer | method for creating an express application with express-compose mixin |
Scope |
<a name="module_express-composer"></a>
method for creating an express application with express-compose mixin
Example
var expressComposer = require('express-composer');
app
⏏
app
function
function
function
Object
| function
| Promise.<Object>
function
| Array.<function()>
String
Object
Object
object
object
Object
Object
Object
app
⏏Creates an extended express app
Kind: Exported function
Example
var express = require('expressComposer'),
app = express();
app
Extends an express app if it was not created with express-compose
Kind: static method of expressComposer
Param | Type | Description |
---|---|---|
app | function | express app |
Example
var express = require('express'),
expressComposer = require('express-composer'),
app = express();
expressComposer.extend(app);
function
Creates an express middle ware handler that will iterate through composers handlers
Kind: static method of expressComposer
Param | Type | Description |
---|---|---|
handlers | Array.<function()> | function | |
scopeProvider | ScopeProvider | the scope of these handlers |
function
Creates an express middle ware error handler that will iterate through composers error handlers
Kind: static method of expressComposer
Param | Type | Description |
---|---|---|
handlers | Array.<function()> | function | |
scopeProvider | ScopeProvider | the scope for these handlers |
function
Create an express middle ware that validates an incoming request
Kind: static method of expressComposer
Param | Type | Description |
---|---|---|
validate | function | validation function |
scopeProvider | ScopeProvider | scope variable |
Object
| function
| Promise.<Object>
Kind: inner typedef of expressComposer
function
| Array.<function()>
Kind: inner typedef of expressComposer
String
Kind: inner typedef of expressComposer
Object
Express application options passed into express
Kind: inner typedef of expressComposer
Properties
Name | Type | Description |
---|---|---|
dotFiles | String | Option for serving dotfiles. Possible values are �allow�, �deny�, and �ignore� |
etag | Boolean | Enable or disable etag generation |
extentions | Boolean | Sets file extension fallbacks. |
index | Object | String | Sends directory index file. Set false to disable directory indexing. |
lastModified | Boolean | Set the Last-Modified header to the last modified date of the file on the OS. Possible values are true or false. |
maxAge | Boolean | Set the max-age property of the Cache-Control header in milliseconds or a string in ms format |
redirect | Number | Redirect to trailing �/� when the pathname is a directory. |
setHeaders | function | Function for setting HTTP headers to serve with the file. |
Object
Options passed into express [Router]{http://expressjs.com/api.html#router}
Kind: inner typedef of expressComposer
Properties
Name | Type | Description |
---|---|---|
caseSensitive | Boolean | Enable case sensitivity. |
mergeParams | Boolean | Preserve the req.params values from the parent router. If the parent and the child have conflicting param names, the child�s value take precedence. |
strict | Boolean | Enable strict routing. |
object
Kind: inner typedef of expressComposer
Properties
Name | Type | Description |
---|---|---|
validator | function | function used to validate the request |
preHandlers | requestHandlers | handlers that will be called during execution of the route |
scope | scopeArg | scope values to inject into the context of the handlers |
errorHandlers | requestHandlers | handlers called if there is an error during the request |
name | String | name of the method |
description | String | description about what this method does |
object
Kind: inner typedef of expressComposer
Properties
Name | Type | Description |
---|---|---|
checkout | requestMethod | requestHandlers | handles checkout requests |
connect | requestMethod | requestHandlers | handles connect requests |
copy | requestMethod | requestHandlers | handles copy requests |
delete | requestMethod | requestHandlers | handles delete requests |
get | requestMethod | requestHandlers | handles get requests |
head | requestMethod | requestHandlers | handles head requests |
lock | requestMethod | requestHandlers | handles lock requests |
m-search | requestMethod | requestHandlers | handles m-search requests |
merge | requestMethod | requestHandlers | handles merge requests |
mkactivity | requestMethod | requestHandlers | handles mkactivity requests |
mkcol | requestMethod | requestHandlers | handles mkcol requests |
move | requestMethod | requestHandlers | handles move requests |
notify | requestMethod | requestHandlers | handles notify requests |
options | requestMethod | requestHandlers | handles options requests |
patch | requestMethod | requestHandlers | handles patch requests |
post | requestMethod | requestHandlers | handles post requests |
propfind | requestMethod | requestHandlers | handles propfind requests |
proppatch | requestMethod | requestHandlers | handles proppatch requests |
purge | requestMethod | requestHandlers | handles purge requests |
put | requestMethod | requestHandlers | handles put requests |
report | requestMethod | requestHandlers | handles report requests |
search | requestMethod | requestHandlers | handles search requests |
subscribe | requestMethod | requestHandlers | handles subscribe requests |
trace | requestMethod | requestHandlers | handles trace requests |
unlock | requestMethod | requestHandlers | handles unlock requests |
unsubscribe | requestMethod | requestHandlers | handles unsubscribe requests |
Object
Kind: inner typedef of expressComposer
Properties
Name | Type | Description |
---|---|---|
methods | requestMethods | methods for this route |
preHandlers | requestHandlers | handlers that are executed before a route method |
errorHandlers | requestHandlers | handlers for errors within this route |
scope | scopeArg | scope argument for this route |
name | String | the name of the route |
description | String | a description of the route |
path | pathArg | the path for the route |
Object
Kind: inner typedef of expressComposer
Properties
Name | Type | Description |
---|---|---|
preHandlers | requestHandlers | handlers that are executed during this route |
routes | routeScore | Array.<routeScore> | routes for this router |
errorHandlers | requestHandlers | handles errors tha occurred in this route |
scope | scopeArg | scope options to include in this scope |
routers | routerScore | nested routers |
name | String | name of this route |
description | String | a description of this route |
path | pathArg | the path to this route |
routerOptions | options for the router |
Object
Kind: inner typedef of expressComposer
Properties
Name | Type | Description |
---|---|---|
preHandlers | requestHandlers | handlers that are executed for this app |
errorHandlers | requestHandlers | handles errors tha occurred in this route |
scope | scopeArg | scope options to include in this scope |
routers | routerScore | Array.<routerScore> | nested routers |
name | String | name of this route |
description | String | a description of this route |
appOptions | options for the router | |
appScore | Array.<appScore> | apps for this app | |
path | pathArg | the path for the app |
vhost | String | a vhost routing string |
properties | Object | an object used to set express options |
FAQs
A composition library to help organize your express routes and handlers
The npm package express-composer receives a total of 4 weekly downloads. As such, express-composer popularity was classified as not popular.
We found that express-composer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.