SvelteKit adapter that automatically detects deployment environment and installs appropriate platform-specific adapter
Overall
score
96%
A utility function that resolves package paths in the node_modules hierarchy, supporting both scoped and non-scoped packages with export path resolution.
Handles both scoped packages (e.g., @scope/package-name) and non-scoped packages.
@sveltejs/kit, it locates the package at node_modules/@sveltejs/kit @testlodash, it locates the package at node_modules/lodash @testSearches up the directory tree from a starting point to find packages in parent node_modules folders.
Reads package.json exports field to resolve subpackage import paths.
@sveltejs/kit/vite, it reads package.json and resolves to the path specified in the exports field @test{import: './path.js', default: './other.js'}, it resolves import first, then default @testProvides clear error messages when resolution fails.
@generates
/**
* Resolves a package path in the node_modules hierarchy.
* Supports both scoped (@scope/name) and non-scoped (name) packages.
* Can resolve subpackage paths using package.json exports.
*
* @param {string} packageName - The package name to resolve (e.g., 'express', '@sveltejs/kit', '@sveltejs/kit/vite')
* @param {string} [startDir] - The directory to start searching from (defaults to process.cwd())
* @returns {string} The absolute path to the resolved package or export
* @throws {Error} When package cannot be found or export doesn't exist
*/
function resolvePackage(packageName, startDir = process.cwd()) {
// Implementation here
}
module.exports = { resolvePackage };Provides peer dependency resolution patterns and implementation reference.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-sveltejs--adapter-autodocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10