🚀 DAY 4 OF LAUNCH WEEK: Introducing GitHub Actions Scanning Support.Learn more →
Socket
Book a DemoInstallSign in
Socket

icontext

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

icontext

# Usage ## Classic ContextFactory

latest
npmnpm
Version
1.2.16
Version published
Maintainers
2
Created
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

Package last updated on 15 May 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