New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

iudex

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iudex

Iudex client

  • 0.13.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
55
decreased by-89.48%
Maintainers
1
Weekly downloads
 
Created
Source

Express

  1. Install dependencies.
npm install iudex
  1. Create a file called instrument.ts or instrument.js (can be in the same directory as your server).
  2. Import and run instrument in instrument.ts.
// import 'dotenv/config'; // Import dot env here if you use it
import { instrument } from 'iudex';
instrument({
  serviceName: <your_service_name>,
  iudexApiKey: <your_api_key>,        // optionally pulls from process.env.IUDEX_API_KEY
  githubUrl: <your_github_url_here>,  // optionally pulls from process.env.GITHUB_URL
});
  1. Add the require flag when running your server, e.g. -r ./instrument.ts
  • Example: node -r ./instrument.js ./app.js
  • Example: bun run -r ./instrument.ts ./app.ts

Fastify

  1. Install dependencies.
npm install iudex
  1. Create a file called instrument.ts or instrument.js (can be in the same directory as your server).
  2. Import and run instrument in instrument.ts.
// import 'dotenv/config'; // Import dot env here if you use it
import { instrument } from 'iudex';
instrument({
  serviceName: <your_service_name>,
  iudexApiKey: <your_api_key>,        // optionally pulls from process.env.IUDEX_API_KEY
  githubUrl: <your_github_url_here>,  // optional, also optionally pulls from process.env.GITHUB_URL
});
  1. In your Fastify file (likely server.ts), add iudexFastify.logger to the Fastify config.
import { iudexFastify } from '../src/instrumentation/index';

const fastify = Fastify({
  logger: {
    ...iudexFastify.logger,
    level: 'info',
  },
});
  1. Add the require flag when running your server, e.g. -r ./instrument.ts
  • Example: node -r ./instrument.js ./server.js
  • Example: bun run -r ./instrument.ts ./server.ts

Lambda

  1. Install dependencies.
npm install iudex
  1. At the top of your lambda handler file, add instrumentation.
import { instrument, withTracing } from 'iudex';
instrument({
  serviceName: <your_service_name>,
  iudexApiKey: <your_api_key>,        // optionally pulls from process.env.IUDEX_API_KEY
  githubUrl: <your_github_url_here>,  // optional, also optionally pulls from process.env.GITHUB_URL
});
  1. Wrap all functions you want traced with withTracing.
export const handler = withTracing(() => {
  ...
});

Pino

  1. Install dependencies.
npm install iudex
  1. Find your where you instantiate your pino logger and add Iudex params.
import pino from 'pino';
import { iudexPino } from 'iudex';

const logger = pino(...iudexPino.args);

Pino config

If you have configured pino, use iudexPino.options and iudexPino.destination separately.

  • iudexPino.options sets the mixin property
  • iudexPino.destination sets the write property
import pino from 'pino';
import { iudexPino } from 'iudex';

const logger = pino(iudexPino.options, iudexPino.destination);

Keywords

FAQs

Package last updated on 17 Jun 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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc