Socket
Socket
Sign inDemoInstall

icontext

Package Overview
Dependencies
11
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    icontext

# Usage ## Classic ContextFactory


Version published
Maintainers
2
Created

Readme

Source

#icontext

Usage

Classic ContextFactory

import { ContextFactory } from 'icontext';
const contextFactory = new ContextFactory({}); // single instance for application lifetime
await contextFactory.build(); // per request

Sync call on application start

Add to script or next.config.js: Warining: uses process.swapwnSync, in all possible cases prefer async version instead

const { buildSync } = require('icontext');
buildSync();

Using --require

node -r icontext/config script.js

Migration from @ilb/node_context:

npm uninstall @ilb/node_context @ilb/node_ldap
npm install icontext
grep -Rl @ilb/node_context src|xargs sed -i "s^ContextFactory from '@ilb/node_context'^{ ContextFactory } from 'icontext'^"

FAQs

Last updated on 15 May 2024

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc