当前位置: 首页 > 文档资料 > Express 中文文档 >

Express 实用模板

优质
小牛编辑
129浏览
2023-12-01

Express utility functions

The pillarjs GitHub organization contains a number of modules for utility functions that may be generally useful.

Utility modulesDescription
cookiesGet and set HTTP(S) cookies that can be signed to prevent tampering, using Keygrip. Can be used with the Node.js HTTP library or as Express middleware.
csrfContains the logic behind CSRF token creation and verification. Use this module to create custom CSRF middleware.
finalhandlerFunction to invoke as the final step to respond to HTTP request.
parseurlParse a URL with caching.
path-matchThin wrapper around path-to-regexp to make extracting parameter names easier.
path-to-regexpTurn an Express-style path string such as ``/user/:name` into a regular expression.
resolve-pathResolves a relative path against a root path with validation.
routerSimple middleware-style router.
routingtonTrie-based URL router for defining and matching URLs.
sendLibrary for streaming files as a HTTP response, with support for partial responses (ranges), conditional-GET negotiation, and granular events.
templationView system similar to res.render() inspired by co-views and consolidate.js.

For additional low-level HTTP-related modules, see jshttp .