Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@kosko/require

Package Overview
Dependencies
Maintainers
1
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kosko/require - npm Package Compare versions

Comparing version 0.0.0-20240324064444 to 0.0.0-20240324074257

dist/index.d.ts.map

56

dist/index.d.ts
/**
* Imports and resolves modules.
* Returns file extensions which can be imported.
*
* @packageDocumentation
* @defaultValue Node.js
* ```js
* [".cjs", ".mjs", ".js", ".json", ".node"]
* ```
*
* @public
*/
export * from "./extensions";
export * from "./resolve";
export * from "./import";
declare function getRequireExtensions(): string[];
/**
* @public
*/
interface ResolveOptions {
/**
* The directory to resolve from.
*
* @defaultValue `process.cwd()`
*/
baseDir?: string;
/**
* File extensions to resolve.
*
* @defaultValue `getRequireExtensions()`
*/
extensions?: readonly string[];
}
/**
* Returns full file path of the given path. This function only supports
* relative or absolute paths of files or directories.
*
* @public
*/
declare function resolvePath(path: string, options?: ResolveOptions): Promise<string | undefined>;
/**
* Returns full file path of the given module id.
*
* @param id - A relative or absolute path to a file or directory, or a module name.
* @public
*/
declare function resolveModule(id: string, options?: Pick<ResolveOptions, "baseDir">): Promise<string | undefined>;
/**
* Imports a module from the given `path`.
*
* @param path - Absolute path to a module. It must not be a file URL or a relative path.
* @public
*/
declare function importPath(path: string): Promise<any>;
export { type ResolveOptions, getRequireExtensions, importPath, resolveModule, resolvePath };
//# sourceMappingURL=index.d.ts.map

8

package.json
{
"name": "@kosko/require",
"version": "0.0.0-20240324064444",
"version": "0.0.0-20240324074257",
"description": "Import and resolve modules.",

@@ -48,3 +48,3 @@ "homepage": "https://kosko.dev",

"resolve-from": "^5.0.0",
"@kosko/common-utils": "^0.0.0-20240324064444"
"@kosko/common-utils": "^0.0.0-20240324074257"
},

@@ -56,5 +56,5 @@ "devDependencies": {

"typescript": "^5.3.3",
"@kosko/jest-preset": "^0.0.0",
"@kosko/build-scripts": "^0.0.0",
"@kosko/test-utils": "^0.0.0",
"@kosko/build-scripts": "^0.0.0"
"@kosko/jest-preset": "^0.0.0"
},

@@ -61,0 +61,0 @@ "jest": {

Sorry, the diff of this file is not supported yet

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