New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@ki2/contextify-express

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ki2/contextify-express

latest
Source
npmnpm
Version
0.12.1
Version published
Maintainers
1
Created
Source

Contextify express

This package give a contextify function to handle actions with express

Usage :

// Simple exemple with external action

const app = express();

function myAction() {
  await wait(100); // wait 100 ms

  useResponse({
    hello: "world",
  });
}

app.get("/route", contextify(myAction));
// Example with multiple actions (in cascade) sharing the context.

const app = express();

app.get(
  "/route",
  contextify(
    () => {
      // first action that set a state
      const test = useState("test");
      test.value = "world";
    },
    () => {
      // second action using the previously set state
      const test = useState("test");

      useResponse({
        hello: test.value,
      });
    }
  )
);

FAQs

Package last updated on 16 Apr 2024

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