Skip to main content
Glama
ESMxCJSHelpers.ts788 B
import { createRequire } from 'node:module'; import { getPackageJsonPath } from './getPackageJsonPath'; export const isESModule = typeof import.meta.url === 'string'; /** * Require relative to the user project * * Note: Can resolve package that are installed in the user project, ex `'intlayer'` */ export const getProjectRequire = (startDir?: string): NodeJS.Require => { // Can fail on VSCode extensions const { packageJsonPath } = getPackageJsonPath(startDir); return createRequire(packageJsonPath); }; /** * Require relative to the @intlayer/config package * * Note: Can resolve package that are installed in the config package, ex `'@intlayer/types'` */ export const configESMxCJSRequire: NodeJS.Require = isESModule ? createRequire(import.meta.url) : require;

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/aymericzip/intlayer'

If you have feedback or need assistance with the MCP directory API, please join our Discord server