Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 8, 2024 via pnpm

@humanwhocodes/module-importer 1.0.1

Universal module importer for Node.js
Package summary
Share
0
issues
1
license
1
Apache-2.0
Package created
17 Aug 2022
Version published
18 Aug 2022
Maintainers
1
Total deps
1
Direct deps
0
License
Apache-2.0

Issues

0
This package has no issues

Licenses

Apache License 2.0

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
use-patent-claims
place-warranty
Cannot
hold-liable
use-trademark
Must
include-copyright
include-license
state-changes
include-notice
1 Packages, Including:
@humanwhocodes/module-importer@1.0.1
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
ⓘ This is a list of @humanwhocodes/module-importer 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does @humanwhocodes/module-importer do?

The @humanwhocodes/module-importer is a powerful, versatile utility designed for Node.js. It allows for the seamless importation of modules, regardless of whether they’re in CommonJS or ESM format. This package leverages the ‘import()’ function and the inherent CommonJS compatibility of Node.js, ensuring the correct location and format are utilized. The key issue it addresses is the relative resolution of the standard ‘import()’. It provides a user-friendly way to resolve and import modules from any directory, negating any issues that might arise from compatibility differences between formats.

How do you use @humanwhocodes/module-importer?

Using the @humanwhocodes/module-importer couldn't be simpler. You primarily need to install it via npm or yarn. Installation commands are 'npm install @humanwhocodes/module-importer' or 'yarn add @humanwhocodes/module-importer'. If using it for a Bun project, use the command 'bun add @humanwhocodes/module-importer'. To import it into your Node.js or Bun project, use the import command. For example, using ESM, type 'import { ModuleImporter } from "@humanwhocodes/module-importer";' or, for CommonJS, type 'const { ModuleImporter } = require("@humanwhocodes/module-importer");'. Once imported, create a new instance of ModuleImporter to start emitting events. Code usage could be something like this:

// cwd can be omitted to use process.cwd()
const importer = new ModuleImporter(cwd);

// you can resolve the location of any package
const location = importer.resolve("./some-file.cjs");

// you can also import directly
const module = importer.import("./some-file.cjs");

Where are the @humanwhocodes/module-importer docs?

For comprehensive information, guides, and API details, the @humanwhocodes/module-importer's documentation can be located on its official Github repository, found at git+https://github.com/humanwhocodes/module-importer.git. By visiting the repository, users gain access to every detail from installation and usage guidance to developer setup and licensing information.

All Versions