Skip to main content

is_foreign_module

Function is_foreign_module 

Source
pub fn is_foreign_module(specifier: &str) -> bool
Expand description

Whether the module specifier is loaded from outside the workspace: from the network (https:, http:) or a registry that downloads it (jsr:, npm:), or from a file that is not the workspace’s own (an absolute path, one in the home directory, a file: URL, one that goes up from where the code runs). A relative ./x.js and an installed package (fs, node:fs, lodash) are not. The reader finds code that loads one as an Act::Downloaded or an Act::Loads; this is the same answer for a specifier a caller meets outside the code, such as a --import option.