🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

node-http-context

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-http-context

Get HttpContext from anywhere

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
4
-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

Node Http Context

Get http context anywhere in node/express application.

How to use it

Install: npm install --save node-http-context

const express = require('express');
const HttpContext = require('node-http-context');

const app = express();
// Initialize Httpcontext middleware service
HttpContext.Initialize(app);
// After initialize the httpcontext we can get httpcontext anywhere

Get HttpContext form anywhare:

const HttpContext = require('node-http-context');

//Node express request object from HttpContext
HttpContext.Request;

//Node express response object from HttpContext
HttpContext.Response.send(HTML/STRING);
HttpContext.Response.json({JSON_Object});

//Node express Next object from HttpContext
HttpContext.Next();

//Node express session object from HttpContext
HttpContext.Session;

Contributors

  • Devesh Kumar (@dkrockcom)

Keywords

HttpContext

FAQs

Package last updated on 05 Dec 2019

Did you know?

Socket

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.

Install

Related posts